POV-Ray : Newsgroups : povray.off-topic : Hungarian notation : Re: Hungarian notation Server Time
4 Sep 2024 01:17:20 EDT (-0400)
  Re: Hungarian notation  
From: andrel
Date: 5 Jun 2010 10:06:57
Message: <4C0A5A01.2080701@gmail.com>
On 5-6-2010 10:25, Warp wrote:
> Darren New <dne### [at] sanrrcom> wrote:
>> I think the same goes for putting "m" or "g" or whatever in for member or 
>> global variables, etc.
> 
>   Why? When I started using those, my own code became much easier to
> understand to me months later. When I have code along the lines of:
> 
>     void Foo::doSomething()
>     {
>         mCounter += someValue;
>     }
> 
> or:
> 
>     void Foo::doSomething()
>     {
>         gCounter += someValue;
>     }
> 
> as opposed to:
> 
>     void Foo::doSomething()
>     {
>         counter += someValue;
>     }
> 
> the first two are much clearer than the third one. The third one doesn't
> make it clear at all where 'counter' might be defined, while in the first
> example it's clear that it's a member variable of the Foo class, and in
> the second one it's clear that it's not. In the third one it could be
> anything.
> 
The objection is not to hungarian notation per se*. It is about using it 
wrongly. Like any other method of (in-line) documentation, if it does 
not match the source it is worse than no documentation at all.

*) though there is the danger that using it without IDE support to 
enforce the correct use, will almost certainly lead to mismatches.


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.