Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

VCL  Coding style

Posted on 2002-03-03
9
377 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
Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 
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 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

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

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…
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…
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…

809 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