Re: Hungarian Notation interest with PHP
| From: | Tony Marston | Date: | Mon, 04 Jun 2012 15:23:49 +0000 |
| Subject: | Re: Hungarian Notation interest with PHP | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-318142@lists.php.net to get a copy of this message | ||
"Mihamina Rakotomandimby" wrote in message news:4FCCC97A.1060400@rktmb.org...
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