Solved

VCL  Coding style

Posted on 2002-03-03
9
365 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
Comment Utility
Beats the hell out of me!  You might want to ask for a little more info.
0
 

Author Comment

by:princemahesh
Comment Utility
Hi Stuart Johnson

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

0
 
LVL 3

Expert Comment

by:tongalite
Comment Utility
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
Comment Utility
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
How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

 
LVL 2

Accepted Solution

by:
DelphiArchitect earned 10 total points
Comment Utility
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
Comment Utility
what/how is your style, james?
0
 
LVL 2

Expert Comment

by:DelphiArchitect
Comment Utility
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
Comment Utility
well, had read it,
and i agree with you, james
0
 

Author Comment

by:princemahesh
Comment Utility
Thanks DelphiArchitect

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

Featured Post

Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

Join & Write a Comment

Introduction The parallel port is a very commonly known port, it was widely used to connect a printer to the PC, if you look at the back of your computer, for those who don't have newer computers, there will be a port with 25 pins and a small print…
Have you ever had your Delphi form/application just hanging while waiting for data to load? This is the article to read if you want to learn some things about adding threads for data loading in the background. First, I'll setup a general applica…
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…
This video demonstrates how to create an example email signature rule for a department in a company using CodeTwo Exchange Rules. The signature will be inserted beneath users' latest emails in conversations and will be displayed in users' Sent Items…

744 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

18 Experts available now in Live!

Get 1:1 Help Now