Im curious what your opinion on Hungarian notation is. It seems most C and C++ programmers dont like it, but I dont see why, it seems like a practical thing to do, especially to know which variables are pointers.
Name:
Anonymous2010-12-10 2:23
I've seen it used in weakly-typed languages, but I don't think I was at an advantage or disadvantage in those cases. In C, I'd just slap people for typedef'ing pointers. type ptrX is not as clear as type* x.
It seems practical, but in actual practice it ends up being clutter because it's not difficult to remember variable types in the chunk of code you're working on. Even if you're new to the code or forget, you need only look at the declarations.
The solution isn't to give things weird names in the hopes that you can be reminded the type, but to have a more intelligent editor, one that will show you the type.
Would you look at that, meaningful variable names! I just name my variables _GXXX, where the XXX stands for a number that's 0 for the first variable and is auto-incremented with each subsequent one.
Hungarian notation is thought by scientific experts to be one of the most blatant systematic violations of the DRY principle possible without actually programming in Java.
Name:
Anonymous2010-12-10 19:27
Hungarian notation is good for the purpose of keeping track of arbitrary pointers, such as those of type void*.