Re:What's the benefit of not using Hungarian notation?
by jerf on Monday August 22, 2011 @01:02PM
(#2913137)
The later statically typed languages like Haskell make it relatively easy to create a type which is internally stored as some base type, like an Integer, but at the type system level is treated as a distinct type. Thus one can not accidentally multiply a Pixel by a Millimeter when trying to compute an area on the screen, while under the hood pixels and millimeters are still just Ints (or whatever). "Real" Hungarian is a good hack for languages lacking that.
Re:What's the benefit of not using Hungarian notation?
by njs12345 on Monday August 22, 2011 @01:46PM
(#2913318)
If you're willing to go even further with Haskell you can do some really crazy stuff: http://code.google.com/p/dimensional/wiki/GMExample
Re:What's the benefit of not using Hungarian notation?
by thalur on Monday August 22, 2011 @12:28PM
(#2912983)
If you are using C++, you can make the units (dimensionality) compile-time checked using templates. See: http://learningcppisfun.blogspot.com/2007/01/units-and-dimen... (that isn't where I came across it, but the code looks basically the same.) It's easy to add more dimensions for any units you care about (pixels for example).
Re:What's the benefit of not using Hungarian notation?
by janjan on Monday August 22, 2011 @01:08PM
(#2913163)
Thanks, that looks very interesting! I wish I would have used this years ago, but (un)fortunately I switched over to Python (and some C for extensions).
Re:What's the benefit of not using Hungarian notation?
by Jebdm on Monday August 22, 2011 @07:39PM
(#2914651)
For Python, check out http://pypi.python.org/pypi/Unum/4.1.0
edit: I just saw that this is basically what [1] is about.
[1] http://www.joelonsoftware.com/articles/Wrong.html