[DUG] class variables - bad language definition

Rohit Gupta rohit at cfl.co.nz
Tue Oct 9 11:44:23 NZDT 2007


Another pitfall for young players.

type
   Taa = class()
   private
     class var xx : yy;
      zz : integer
  public


The xx declaration makes all other variables after it class ones as 
well.  I know its documented, but one doesn't realise the impact until 
after falling in the hole.  And the hole remains in my code for a future 
developer to fall into.  This is specially bad after being used to the 
class function declaration which works differently.

I hate this sort of stuff, the code can not become more robust if a 
declaration of a new variable affects previous declarations.

-- 
*Rohit Gupta*
* B.E. Elec.   M.E.   Mem IEEE    Associate IEE*
*Technical Manager*
*Computer Fanatics Limited*
** 
*Tel*     +64 9 4892280
*Fax*    +64 9 4892290
*Email  *rohit at cfl.co.nz <mailto:rohit at cfl.co.nz>**
*Web    *www.cfl.co.nz <http://www.cfl.co.nz/>
 
------------------------------------------------------------------------
This email and any attachments contain information, which is 
confidential and may be subject to legal privilege and copyright. If you 
are not the intended recipient, you must not use, distribute or copy 
this email or attachments. If you have received this in error, please 
notify us immediately by return email and then delete this email and any 
attachments.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.adventureeducation.co.nz/pipermail/delphi/attachments/20071009/ac4cdf22/attachment.html


More information about the Delphi mailing list