From: Logan Capaldo Date: 2006-01-21T05:35:30+09:00 Subject: Re: Hungarian Case variable names. On Jan 20, 2006, at 2:13 PM, James Edward Gray II wrote: > On Jan 20, 2006, at 12:21 PM, Zach wrote: > >> Does anyone see advantages to using Hungarian Case to variable >> names in >> Ruby, or do you think it may hinder as some people call "accidental >> abstraction" [Bill Davis] ? > > I assume you know this, but just to be sure, Joel on Software has a > semi-famous article about the virtues of Hungarian Notation: > > http://www.joelonsoftware.com/articles/Wrong.html > > If you make it all the way to the end of that, it talks about how > the notation is intended to show a "kind", not "type". When used > that way, I can't decide if it interferes with Duck Typing or > not... A great example is escaping me. > > It may indeed be useful, but it is hard to argue that it isn't > ugly. ;) > > James Edward Gray II > > As I was reading this, all I kept thinking of was ML/Haskell. In pseudo ML: type unsafe_string = UString of string type safe_string = SString of string Request :: string -> unsafe_string Encode :: unsafe_string -> safe_string Write :: safe_string -> unit etc.. Now the compiler is tracking all this junk for you. I realize this is the land of duck-typing, but I think if the type-inference is good enough, you can have your cake and eat it too.