Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

VCL  Coding style

Posted on 2002-03-03
9
Medium Priority
?
398 Views
Last Modified: 2010-04-05
Hi

I work in dephi occationally.

I have been ask to develop a program in delphi.
and the specification has one heading like this:

Coding style
------------

The VCL is to be used as the reference for the style of the code. Further guidelines generally accepted by the Delphi community

What does it mean to use the VCL coding style?
0
Comment
Question by:princemahesh
  • 2
  • 2
  • 2
  • +3
9 Comments
 
LVL 6

Expert Comment

by:Stuart_Johnson
ID: 6838453
Beats the hell out of me!  You might want to ask for a little more info.
0
 

Author Comment

by:princemahesh
ID: 6838506
Hi Stuart Johnson

I won't mind if you give me little more info.

0
 
LVL 3

Expert Comment

by:tongalite
ID: 6838838
Hi princemahesh

I believe stuart meant you should ask for more
information from the people who want you to
write the program :)

Coding in the vcl style? that's very ambiguous...
It could mean anything!
Perhaps how the code is formatted...?
Bold keywords, indented lines, lots of commented
lines for the benefit of others maintaining or
amending the code and economic routines instead of
lengthy other options that achieve the same result.

I'm interested what our expert colleagues make of
this 'VCL style' definition (?)

Good luck
tongalite
0
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 
LVL 6

Expert Comment

by:zebada
ID: 6838914
I always assumed VCL style meant stuff like the following:

- Class names start with a capital T - TStringList
- property storage variables start with F - FCount, the property name itself would be Count.
- property access functions are prefixed with Get or Set
- Events names start with On - OnClicked
- Components all have a specific prefix.
and so on...

I don't know if it is written down anywhere - I've just picked it up by looking at the VCL code.

Hope that helps
Paul
0
 
LVL 2

Accepted Solution

by:
DelphiArchitect earned 30 total points
ID: 6839280
Borland has published a "Style Guide" for Delphi code, which is the same style they use when writing the VCL.  I believe this is fairly common knowledge, thus it is most likely that they are refering to this.  They require any submissions of code to be included in future versions to use this style (unfortunate).  It is also very similiar to the guidelines adopted by Project JEDI.  For more information check out Borland's community web site (this is where they published the document) and/or the Project JEDI web site.

For the record, I think the "VCL Style" is horrible.  If you've ever had to read though large sections of the VCL you probably understand what I mean.  Somtimes I have to copy the code out and reformat it to make it a bit easier to follow.  In particular I don't like how they indent...  What really annoys me, however, is that they are trying to force their style on the Delphi community.

DelphiArchitect
James Higgins
0
 
LVL 27

Expert Comment

by:kretzschmar
ID: 6839755
what/how is your style, james?
0
 
LVL 2

Expert Comment

by:DelphiArchitect
ID: 6840536
Well, like any consistent style (that I've ever heard of, anyway) it can't be summarized very well.  One of these days I'm going to actually write a style guide for my style of coding.  

Basically, I like consistent indentation so that it is very obvious where the nesting occurs.  With the "VCL Style" it is sometimes difficult to tell exactly what occurs in each scope, espicilly when dealing with then/else statements.

Don't get me wrong, though, I've seen much worse than the "VCL" style.  In particular I really dislike hungarian notation, which makes maintenance and change much more difficult.  It also makes grouping associated identifiers difficult.

If you REALLY want to know what I think, look up an article on the Borland Community web site titled "Hungarian Peanut Butter" and see my comments on it.

Delphi Architect
James Higgins
0
 
LVL 27

Expert Comment

by:kretzschmar
ID: 6840933
well, had read it,
and i agree with you, james
0
 

Author Comment

by:princemahesh
ID: 6841111
Thanks DelphiArchitect

I think they are mainly refering to Delphi coding standards as placed on the borland site.
0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Hello everybody This Article will show you how to validate number with TEdit control, What's the TEdit control? TEdit is a standard Windows edit control on a form, it allows to user to write, read and copy/paste single line of text. Usua…
In my programming career I have only very rarely run into situations where operator overloading would be of any use in my work.  Normally those situations involved math with either overly large numbers (hundreds of thousands of digits or accuracy re…
this video summaries big data hadoop online training demo (http://onlineitguru.com/big-data-hadoop-online-training-placement.html) , and covers basics in big data hadoop .
Despite its rising prevalence in the business world, "the cloud" is still misunderstood. Some companies still believe common misconceptions about lack of security in cloud solutions and many misuses of cloud storage options still occur every day. …

971 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question