On Mon, Nov 02, 2020 at 11:24:39AM -0500, Barry MacKichan wrote: > When I interviewed at Microsoft, one of my interviewers was Charles Simonyi, > the originator of what is called “Hungarian”. It is a small set of rules and a > bunch of prefixes used to encode type information in variable and function > names. For example, ‘lpszName’ is the name of a long pointer to a > zero-terminated string. It doesn’t work well when there are a lot of > user-defined types, such as C++ classes.
It doesn't work well at any point. Basically, the name could be lying, for example if the implementation has been changed, but the variable name not. Therefore, if you need to know the type of something, then you need to look it up (modern IDEs make this pretty easy), not assume that the variable name tells you anything about it's type. Also, there are some many variants of "Hungarian", it gets pretty silly after a while. Years of reading code has taught me to filter out hungarian prefixes as meaningless line noise. -- ---------------------------------------------------------------------------- Dr Russell Standish Phone 0425 253119 (mobile) Principal, High Performance Coders [email protected] http://www.hpcoders.com.au ---------------------------------------------------------------------------- - .... . -..-. . -. -.. -..-. .. ... -..-. .... . .-. . FRIAM Applied Complexity Group listserv Zoom Fridays 9:30a-12p Mtn GMT-6 bit.ly/virtualfriam un/subscribe http://redfish.com/mailman/listinfo/friam_redfish.com archives: http://friam.471366.n2.nabble.com/ FRIAM-COMIC http://friam-comic.blogspot.com/
