[fpc-devel] Interface to compressed files and archives
Michael Van Canneyt
michael at freepascal.org
Sat Jan 1 18:46:11 CET 2005
On Sat, 1 Jan 2005, DrDiettrich wrote:
> Michael.VanCanneyt at Wisa.be wrote:
>
> > > E.g.: gzip.xyz, is this based on a gzip unit or a gzip variable or...
> >
> > Does this matter to you ?
> >
> > Normally one never uses a fully qualified identifier.
>
> And that can become a problem, when a variable and a unit has the same
> name. That's why I do not only prefer to prefix type names with "T", but
> also unit names with "u", form (unit) names with "f" etc. As prefixes
> for specific kinds of units seem to be in use by other people as well,
> why not prefix all units?
Because it doesn't seem necessary.
>
> > Only when a possible name conflict exists, which
> > - Should be very rare, and avoided in the first place.
> > - In such cases it will be obvious from the context.
>
> Okay, name clashes between unit and variable names should be detectable
> easily. But then a decision has to be made, which of both names should
> stay unchanged, and which one to decorate. My preference then is to
> decorate the unit names, because these occur less frequently in source
> code, and almost only in obvious Uses clauses.
You are free to do so :)
>
> I know that my private prefix style is a bit uncommon, as is my coding
> style (indentation...). In shareable contributions I'm willing to follow
> the more widely accepted standards, of course :-)
It depends a bit on the context. Large Delphi component suites all have
their unit names prefixed with a prefix that identifies the suite.
There is even a registration system somewhere on the net, to 'register'
your prefix. If you're going to make an all-purpose archiving suite,
I suggest you do the same: use a common prefix (as proposed in an
earlier mail) like ar, vfs, dca or whatever.
Michael.
More information about the fpc-devel
mailing list