Re: Hungarian Notation interest with PHP

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



"Mihamina Rakotomandimby" wrote in message news:4FCCC97A.1060400@xxxxxxxxx...

Hi all,

I have a colleague stuck with this thing named "Hungarian Notation"
http://goo.gl/xYv8O

We try to define our internal coding standards, which is very close to the Symfony ones http://goo.gl/f2rcO

But we're in conflict because the colleague really argue about his "Hungarian Notation".

Have you got some ressources arguing against this? I ran out of mine to convince him...


Take a look at http://en.wikipedia.org/wiki/Hungarian_notation which shows that quite a few 'big' names are against it.

I personally hate it because it ties a variable to a particular type, which in PHP is useless as a variable is allowed to change its type 'on the fly'. Even in a strongly typed language it can cause problems - I remember many years ago having a variable called $numCustomerId because CustomerId was supposed to be numeric. Then it transpired that it could actually contain alpha characters, so it had to be a string and not a number. Changing all occurrences of $numCustomerId to $strCustomerId was a royal PITA, but it would have been totally confusing to allow alpha characters in a variable that was supposed to contain nothing but numbers.

--
Tony Marston

http://www.tonymarston.net
http://www.radicore.org

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux