[lazarus] Name Confilct in fpc

Kevin Berry kevinbe71 at yahoo.com
Tue Feb 29 10:31:20 EST 2000




--- Michael Van Canneyt <michael.vancanneyt at wisa.be>
wrote:
[...snip...]
> > type
> >   TSomeObject = class(TObject)
> >   private
> >     FSomeVar: TSomeType;
> >     ........
> >   public
> >     procedure DontWork(Dummy: String; SomeVar:
> TSomeType);
> >     procedure ......
> >   published
> >     property SomeVar: TSomeType Read FSomeVar; 
> >   end;
> > 
> > The Fix is easy...
> > 
> > procedure DontWork(Dummy: String; aSomeVar:
> TSomeType);
> 
> This is done deliberately. We feel that having the
> same name in a
> parameter of a method and a property name is very
> bad coding and
> should not be allowed. This is, of course, debatable
> since you could
> e.g. argue that the procedure starts a new scope,
> and that within
> this scope you can redefine any symbol etc etc
> etc...
> 
> Probably we'll make some compatibility switch, but
> don't count
> on it for the near future.
> 

This is disappointing to hear.  I don't believe the
compiler should force good programming practice.  In a
sense you're creating a new language by doing this.  I
feel that FPC should be fully Object Pascal compliant.
 It may be a good idea to have a flag which turns on
the strict coding rules (ie. the default would be like
Delphi).  However, I would favour a "HINT" or
"WARNING" generated by the compiler to let you know
you're doing something bad.  I usually compile my apps
in Delphi and make sure that I get rid of all of the
"HINTS" and "WARNINGS".  Just my 2c.

Cheers,
Kevin.
__________________________________________________
Do You Yahoo!?
Talk to your friends online with Yahoo! Messenger.
http://im.yahoo.com






More information about the Lazarus mailing list