Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Unit Naming convensions

0 views
Skip to first unread message

SiegfriedN

unread,
May 9, 2005, 9:36:21 AM5/9/05
to
Hi,

How do you name your units?

I do the following.

I always use a 'U' prefix in front of the unit name (almost like 'T' for
a classname)

If the unit is a form unit i.e. has a xfm then I call the unit
'U' + <formname>.pas e.g. UfrmMain.pas

If the unit is not a form unit then I use a project/company abr. prefix
after the 'U' prefix. as in 'U' + 'proj/company' + <unitname>.pas e.g.
UabcTypes.pas

--

A different convension I can think of is to loose the 'U' and always use
the proj/company prefix in Caps e.g. ABCDETypes.pas, ABCDEfrmMain.pas, etc.

Also, for a case sensitive OS like Linux, it is perhaps a good idea to
use only lower case letters?

Any other better suggestions? I am willing to addapt :)

siegs

Marco van de Voort

unread,
May 9, 2005, 10:33:31 AM5/9/05
to
On 2005-05-09, SiegfriedN <snied...@yahoodotco.uk> wrote:
> How do you name your units?

Just give them sound names. Sometimes if a bunch of unit belongs together
(e.g. a subsystem) they get a common prefix.

> Also, for a case sensitive OS like Linux, it is perhaps a good idea to
> use only lower case letters?

And I always use lowercase letters. This makes copying with wildcards under
*nix a lot easier.

> Any other better suggestions? I am willing to addapt :)

Don't bother, not much to gain with such details.

Hür Akdülger

unread,
May 10, 2005, 6:49:22 AM5/10/05
to
I always use these notations:
For conventional proceures and functions ???Lib.pas
For classes, components, and other types. ???Typ.pas
For variable and constants ???Var.pas
For forms and frames ???Frm.pas (form names will be F???)

??? means main purpose of unit.

Hür AKDÜLGER

"SiegfriedN" <snied...@yahoodotco.uk> wrote in message
news:427f...@newsgroups.borland.com...

SiegfriedN

unread,
May 10, 2005, 8:30:58 AM5/10/05
to
Marco van de Voort wrote:
>
> Don't bother, not much to gain with such details.

To me it starts to matter when you have a variety of applications. I
guess a different directory sorts it out, but for example having 3rd
party component libs each lib unit needs to have a unique name.

Another thing, when you have a client and a app server in the system the
unit names could differenciate between the client and the server as well.

I have units with 'base' classes, utils - common to all apps which I
prefix with 'PEX' in this case.

I just wanted to know if there was a standard people use - i.e. I do not
necessarily want to enforce my way of doing things when there was not a
proper naming system before..

Siegs

Marco van de Voort

unread,
May 10, 2005, 9:33:27 AM5/10/05
to
On 2005-05-10, SiegfriedN <snied...@yahoodotco.uk> wrote:
> Marco van de Voort wrote:
>>
>> Don't bother, not much to gain with such details.
>
> To me it starts to matter when you have a variety of applications. I
> guess a different directory sorts it out, but for example having 3rd
> party component libs each lib unit needs to have a unique name.

Sure. But IMHO a best effort is the best solution, and resolve the few
problems by hand. Complicated systems have the disadvantage that everybody
has its own little system, and you end up with a bunch of different systems.

> I just wanted to know if there was a standard people use - i.e. I do not
> necessarily want to enforce my way of doing things when there was not a
> proper naming system before..

Nope. I think if you want this you really want namespaces for units. (I don't,
since that opens up a whole different can of worms)

Ender

unread,
May 16, 2005, 8:02:39 AM5/16/05
to
f* - prefix for forms. d* - for data modules. u* - for function and
interface libraries. c* - for class declarations.

An examples:

fPersonSelect.pas contain form that is able to select person from the list
of persons.
dUsers.pas contain data module which most likely manipulate with table of
users.
uFileUtils.pas useful utilites for handling of files.
cPerson.pas declares a class named TPerson.

"SiegfriedN" <snied...@yahoodotco.uk> wrote in message
news:427f...@newsgroups.borland.com...

0 new messages