[fpc-pascal] Re: Duplicate Identifier

Marcos Douglas md at delfire.net
Fri Mar 2 15:55:23 CET 2012


On Fri, Mar 2, 2012 at 10:48 AM, leledumbo <leledumbo_cool at yahoo.co.id> wrote:
>> But if I have many methods with a identifier like Value, I will have
> to modify all methods and put something like lValue, Value1, etc.
>
> Trust me, that's MUCH better than letting the compiler compiles wrong code.
> i.e. it refers to identifier we don't mean to refer. I've had a lot of this
> before and the compiler really helps here to avoid hidden error. I usually
> don't use prefix on identifiers but rename it to something more appropriate
> (or specific) instead.

The "prefix approach pattern" is used a long time in arguments, e.g.,
AValue (I prefer aValue).
We do not have case-sensitive so, everything should have a prefix or
something to distinguish an indentifier of other (types, classes,
interfaces, units, etc);

I'm just following the pattern of language.  ;-)

Marcos Douglas



More information about the fpc-pascal mailing list