3 ms·
This is a bit offtopic but perhaps interesting: Joel Spolsky wrote an article, Making Wrong Code Look Wrong[0], which includes a defense of the original Hungari
by filoeleven 10y ago
This is a bit offtopic but perhaps interesting: Joel Spolsky wrote an article, Making Wrong Code Look Wrong[0], which includes a defense of the original Hungarian notation--called Apps Hungarian--that I find rather convincing.
Essentially, the original intent was not to encode the type in the variable name, but the kind. One example given is from the Excel codebase, where ints are used for tracking both rows and columns, but it doesn't make sense to assign values between them (save for rare circumstances like transposition). This is made explicit by prefixing rows with "rw" and columns with "col". If you ever saw something like "rwMax = colCurrent" it sticks out immediately as being wrong since you know that those two kinds of variables shouldn't mix. The assignment is legal and the compiler won't help you; the semantic naming scheme will.
Encoding the type, like "ul" prefix for "unsigned long", is of course awful and unnecessary and deserves all the derision it has gotten over the years.
[0]http://www.joelonsoftware.com/articles/Wrong.html http://www.joelonsoftware.com/articles/Wrong.html
- deleted 10y ago[deleted]