[fpc-devel] Local variable names and colision with attributes/properties names

Marcos Douglas md at delfire.net
Thu Sep 27 19:08:27 CEST 2012

On Thu, Sep 27, 2012 at 1:55 PM, Graeme Geldenhuys
<graeme at geldenhuys.co.uk> wrote:
> On 2012-09-27 17:46, Marcos Douglas wrote:
>> This "feature" have the origin in a bug in compiler.
> Yeah, but it takes a human to debug such issues. The compiler might have
> no problem understanding complex scopes, but the same could not always
> be said for programmers.
> My code was affected by this change too, but all-in-all, I think it was
> a good move. Promote the idea of "easier to read and understand" code -
> the original goals of Pascal.

I agree. But because the same feature I see programmers using poor
names in local variables.
Ok, just say: use a prefix. But each one programs using the own style!
See FPC code, Lazarus code, etc. Even in the same project, you see many styles.

Maybe would be better to force everyone (no sarcarm) to use:
- Classes should have the prefix "T";
- Arguments should have the prefix "A";
- Local variables should have the prefix "L" or "l"
- Pointer..."P";
- Interfaces... "I";
- Records... "R" (?)
- Constants... UPPER_CASE? cSomething?

At least we would have a good and unique style.

Marcos Douglas

More information about the fpc-devel mailing list