Timeline for Is using parameter names that differ from type names only by casing considered a bad practice in C#?
Current License: CC BY-SA 3.0
9 events
when toggle format | what | by | license | comment | |
---|---|---|---|---|---|
Apr 22, 2018 at 21:54 | comment | added | Graham | @DawoodibnKareem I've read it, but he's simply wrong - or more accurately, he was writing from a position which was kind-of valid 20 years ago but isn't now. (Even in 2005, IDEs were smart enough to sort this.) Helping the coder's eyeballs spot the problem is wrong, as shown by all safety-related coding standards, which all insist on static analysis because coders' eyeballs are not as reliable as Joel thought. Letting your compiler and static analysis tools find these bugs for you will always be better (and that's an evidence-based statement from MISRA and from the authors of DO-178B). | |
Apr 22, 2018 at 10:28 | comment | added | Dawood ibn Kareem | @Graham I take it from your objection to "any flavour of" Hungarian notation, that you have not read Joel Spolsky's article on the usefulness of genuine Hungarian notation | |
Apr 21, 2018 at 20:19 | comment | added | Graham | @PeterMortensen Any flavour of it. I can appreciate why it was needed for BCPL, and in a time without good IDEs, but 40 years later it's just inappropriate. But I wanted to use it as an example of how a bad choice of names (and in that case, one which would be enforced by the coding standard) can leave you vulnerable to bugs from easy-to-make typos. The message wasn't "Hungarian notation considered harmful" (which is just an opinion), it was "typo vulnerability considered harmful" (which is evidence-based best practice). | |
Apr 21, 2018 at 6:34 | comment | added | Peter Mortensen | Are we talking about the original Hungarian notation or how it was grossly misinterpreted by Microsoft (near "the documentation writers on the Windows team inadvertently invented what came to be known as Systems Hungarian" and also in interview of Joel Spolsky by Leo Laporte on Triangulation episode 277, 2016-12-12, 04 mins 00 secs - 06 mins 35 secs)? | |
Apr 20, 2018 at 14:04 | comment | added | Graham | @T.Sar True enough. "Those who do not remember the past are doomed to repeat it" and all that. :/ | |
Apr 20, 2018 at 12:19 | comment | added | T. Sar | I'm aware that you're not proposing the use of Hungarian Notation, but I'm also aware that young devs have a enormous weakness for things with cool names. Being able to say "My code is written in this super secret ninja coding style - the Hungarian Notation!" may sound irresistibly cool to the younger minds. I've seen too many devs fall prey to the hype of cool words... Hungarian Notation is pain give the form of source code x.X | |
Apr 20, 2018 at 12:13 | comment | added | Graham | @T.Sar Even back in the day, I hated it with a passion! As you say, better IDEs have solved the problems it was aimed at, but it still appears every so often. You'll still see it if you need to talk to the Windows API, for instance, for historical reasons. I didn't want to totally bash people's preferred styles if they really like it, but I did want to use it as a hook for showing that upper/lower case isn't the only way you can screw up naming. | |
Apr 20, 2018 at 12:07 | comment | added | T. Sar | Just a note for the readers - for C#, people should really avoid Hungarian Notation. While it was useful in older times when syntax highlight wasn't a thing or was limited, nowadays it really doesn't help. | |
Apr 20, 2018 at 10:51 | history | answered | Graham | CC BY-SA 3.0 |