Solved

VCL  Coding style

Posted on 2002-03-03
9
378 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
[X]
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
  • 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
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
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

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

Suggested Solutions

A lot of questions regard threads in Delphi.   One of the more specific questions is how to show progress of the thread.   Updating a progressbar from inside a thread is a mistake. A solution to this would be to send a synchronized message to the…
In this tutorial I will show you how to use the Windows Speech API in Delphi. I will only cover basic functions such as text to speech and controlling the speed of the speech. SAPI Installation First you need to install the SAPI type library, th…
Exchange organizations may use the Journaling Agent of the Transport Service to archive messages going through Exchange. However, if the Transport Service is integrated with some email content management application (such as an antispam), the admini…

735 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