2 ms·
There's a lengthy section in here on Hungarian notation and there's a statement in here that caught my eye: "Flagrantly violate the Hungarian-esque concept tha
by unsignedqword 10y ago
There's a lengthy section in here on Hungarian notation and there's a statement in here that caught my eye:
"Flagrantly violate the Hungarian-esque concept that function parameters and other high visibility symbols must be given meaningful names, but that Hungarian type warts all by themselves make excellent temporary variable names."
A common mini-"Hungarianism" in most people's code is the naming convention of boolean variables and functions, usually by prefixing the name with 'is' + 'has' + 'can' and/or suffixing the name with a question mark (if the language allows it). I thought this was a near universal convention but every once in a while I come across code that doesn't follow this rule, to which I go - "Really?" (Although I will say that combining true Hungarian notation with that - e.g. bIsAbleToDoThing - seems too redundant.)
On a semi-related note, I wonder why such seemingly little slip-ups (not even the worst examples in the article, which are unlikely to find in the wild anyway) in the mere naming and formatting of things can become so irritating to us programmers. Why do things like Hungarian notation seem to hurt the readability of a program, despite usually just being the addition of just one letter to an identifier? You would think that we should just easily be able to ignore and look past these little things, but it's difficult not to notice them, even if you kind of get used to working on shitty code.