lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


On Fri, 2 Sep 2005 14:42:29 -0700
"Vijay Aswadhati" <wyseman@pacbell.net> wrote:

> 
> > > I've come up with a simple scheme for naming my variables which
> > > i've
> > sticked
> > > to for like 50.000 lines of Lua code:
> > > nNumber = 123
> > > 	iInteger = 123 or rReal = 1.23 to differentiate where needed
> > a dude named Charles Simonyi came up with a similar scheme
> > some time ago which is known as "Hungarian Notation".
> > Searching for this will lead you to endless fruitless
> > discussions ...
> 
> Yes. And you will find me in the camp against Charles Simonyi. After
> years of campaigning FOR hungarian notation it is refreshing to note
> that Microsoft has abandoned in their .NET/C# codeline. You may still
> find some traces of it here and there in code writen by those
> instituitionilized to that notation. 
> 
> My gripe against that notation is simple: what happens when you decide
> that a byte (bByte) today becomes an integer (iInteger) or a double
> (rReal). Naming variables hard coded to their type is baaaad. They
> should be named for their purpose.

My understanding is that Simonyi's original proposal was, in fact, about
just that, naming variables for their purpose... regardless of what
Hungarian Notation has come to mean since then.  A fairly good article
about this is http://www.joelonsoftware.com/articles/Wrong.html :

"... Somebody, somewhere, read Simonyi's paper, where he used the word
"type," and thought he meant type, like class, like in a type system,
like the type checking that the compiler does. He did not. He explained
very carefully exactly what he meant by the word "type," but it didn't
help. The damage was done..."

-Chris