3 ms·
You've not seen ugly code until you've read 90s-era Win32 UI code written with Hungarian notation everywhere. Ugly code comes from the programmer, not the langu
by quotemstr 14y ago
You've not seen ugly code until you've read 90s-era Win32 UI code written with Hungarian notation everywhere. Ugly code comes from the programmer, not the language.
- gte910h 14y agoIt definitely comes from both. Objective C Block prototypes? C typedefs? blech.
- chc 14y agoUnless I misunderstand you, block type syntax is almost identical to function pointers. In both cases, you should generally typedef them and then your code is once again free from ugliness.
- gte910h 14y agoFunction pointers are also blech looking.
- jfb 14y agoHaving to typedef at all is a sign of deep, unfixable badness.
- Jach 14y agoI'm not sure how you arrived at that belief, unless perhaps you think everything should be (visibly to the programmer) type-free? Care to elaborate? I think it would be nice if C and C++ supported more type semantics than `typedef` and `class`, say something as powerful as Haskell's system...
- jfb 14y agoIt's the fundamental unfixable crappiness of C declaration syntax that makes 'typedef' necessary.
- swift 14y agoI am unable to reply to my sibling poster, but I believe what you're saying is that having a hideous and unreadable syntax that forces the use of typedefs just so others can understand what you have written is a sign of deep, unfixable badness. And I agree.
- sriramk 14y agoI blame the early Windows team by mistaking what Simonyi meant with Hungarian notation by misunderstanding what 'type' means. Which is why Office uses his notation in a much cleaner fashion.
- dagw 14y agoYea it's a shame that Hungarian notation has gotten such a bad rap. Done right i find it occasionally useful. Done the way most windows programmers have been taught is an abomination.
- oh_sigh 14y agoCan you give an example(or a link to an article discussing this)? I've never had the displeasure of working with the Windows API(though I often shook my head when I saw code for it)
- sriramk 14y agoBasically he intended 'type' as not 'datatype' as in 'dwSomething' (for double word) but the purpose of the variable. For example, if you're using an integer variable to store the length of some entity, you would name it something like 'lenSomething' as opposed to 'dwSomething'. Storing the type of the variable makes little sense as in most cases it is only a quick grep away.
- flogic 14y agoIn the example you used, "context" seems to be a more appropriate word than "type".
- akldfgj 14y ago/bites tongue, and provides links: http://en.wikipedia.org/wiki/Hungarian_notation#Systems_vs._Apps_Hungarian http://en.wikipedia.org/wiki/Hungarian_notation#Systems_vs._... https://www.google.com/search?q=hungarian+notation https://www.google.com/search?q=hungarian+notation