Solved

VCL  Coding style

Posted on 2002-03-03
9
368 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
 
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
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
LVL 2

Accepted Solution

by:
DelphiArchitect earned 10 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Introduction Raise your hands if you were as upset with FireMonkey as I was when I discovered that there was no TListview.  I use TListView in almost all of my applications I've written, and I was not going to compromise by resorting to TStringGrid…
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…
Learn how to create flexible layouts using relative units in CSS.  New relative units added in CSS3 include vw(viewports width), vh(viewports height), vmin(minimum of viewports height and width), and vmax (maximum of viewports height and width).
Both in life and business – not all partnerships are created equal. As the demand for cloud services increases, so do the number of self-proclaimed cloud partners. Asking the right questions up front in the partnership, will enable both parties …

920 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

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now