[fpc-devel] Suggestion for change: Overly strict check

Vinzent Hoefler JeLlyFish.software at gmx.net
Wed Oct 4 08:44:30 CEST 2006


On Tuesday 03 October 2006 16:26, Flávio Etrusco wrote:

> At my workplace we've standardized on using three "scope prefixes":
> p_ for function parameter, m_ for members/fields, and g_ for global.

I know that discussion, I lost it at work already, but apart from C 
where every identifier is sort of global, there's absolutely no need 
for this:

Writing this/self. removes the need for m_ and even adds some sort of 
safety, because that's one rule the compiler can actually check. - 
That's one.

The difference between locals and paranetrized locals does not need to 
be mentioned at all, because inside the function they behave the same 
and have the same scope. - That' two.

Globals should be forbidden. That's three.
Hmm, ok, if really needed, you should prefix the unit name to ensure 
sudden name clashes (like my "Break" identifier) anyway, so globals are 
easily identified simply by being used already. - So, now that's three.

> I have used "scope prefixes" long before this/them and I as a
> somewhat-die-hard-Pascal-programmer had a hard time getting used to
> the underscores, which seems to divide the identifier and makes you
> code look like C, but I barely notice it now ;-) And it's very
> practical for code completion :-)

Well, since my variable names tend to be longer than four chars, I 
always use underscores and my code sure does NOT look like C. ;)

ItMakesIdentifiersMoreReadableBecauseTheUnderscoreIsAsCloseAsYouCanGetToNormalTextWithoutUsingWhitespace.


Vinzent.




More information about the fpc-devel mailing list