View Single Post
11-30-2007, 02:52 AM
La Vida es Sueño
Join Date: Sep 2007
I use Hungarian notation because you can clearly see what each variable should be containing. Albeit I do admit that with PHP being the way it is, us PHPers shouldn't have to worry about what each variable is storing, as long as it is storing something relevant to our script, right? Well, you're right, but I find it's always nice to care even though there's no call for it.
Here at TalkPHP we seem to love the Hungarian notation
(Bluesaga did a little tips guide on them
, and I have seen 1 or 2 people around the Interweb commenting on the vast amount of TalkPHP's articles about the use of
for a string. True,
is technically for a zero-terminated string and PHP does not have those - only C++ to name one. However, the reasoning for that is
looks nicer than
, and for that I do admit my vanity!
I was merely wondering on other programmer's view on Hungarian notation. For me, I'd rather see:
I've seen people giving all sorts of pet names to their variables. In fact, the one and only Winsrev was one of those who had some very peculiar variable names if I remember rightly, but then again, didn't we all at one stage?
Another good thing about the Hungarian notation is that you can enforce variables yourself, even though PHP doesn't seem to care, by extracting the first 1 or 2 variable prefixes and then modifying its data type to match.
For further information on Hungarian notation before sharing your opinion, you may wish to have a read of
its Wikipedia page
So, are we caring too much, or is Hungarian notation really helpful in programming?
The man who comes back through the Door in the Wall will never be quite the same as the man who went out.
View Public Profile
Send a private message to Wildhoney
Visit Wildhoney's homepage!
Find More Posts by Wildhoney