Re: How to name variables in a program?
- From: Rob Morris <rm445@xxxxxxxxxxxxxx>
- Date: Mon, 30 May 2005 12:15:54 +0100
Arafangion wrote:
I came across a rumour (I _think_ I got it from www.joelonsoftware.com), but the rumour suggests that Hungarian notation originated from a missunderstanding of Apps hungarian, particularly on the word 'type'.
For instance, Apps Hungarian would never simply say iWidth, but would use something more like scrWidth, and scrHeight, with a convention that scr means "the screen", which helps you not mix it with, say, panelWidth and panelHeight.
I'm going out on a limb here, could someone confirm or deny this?
No help on the veracity of the claim, but here is the article:
http://www.joelonsoftware.com/articles/Wrong.html
It's an interesting article, OP should have a look. As you say, Joel suggests that in its original form Hungarian noted the _kind_ of variable, not the variable _type_. An example from the excel source being xl, xw and cb prefixes, all ints, but one is the coordinate relative to the layout, the next relative to the window, and the last a count of bytes. Then if you name all your functions prefixFromWhatever, it becomes clear if you've made an error, e.g.
xlThis = cbThat;
is clearly incompatible.
Rob M .
- Follow-Ups:
- Re: How to name variables in a program?
- From: Martijn
- Re: How to name variables in a program?
- From: Martijn
- Re: How to name variables in a program?
- References:
- How to name variables in a program?
- From: SerGioGio
- Re: How to name variables in a program?
- From: Martijn
- Re: How to name variables in a program?
- From: Phlip
- Re: How to name variables in a program?
- From: spinoza1111
- Re: How to name variables in a program?
- From: Arafangion
- How to name variables in a program?
- Prev by Date: Re: Creationist software engineering? A frightening possibility!
- Next by Date: Re: Creationist software engineering? A frightening possibility!
- Previous by thread: Re: How to name variables in a program?
- Next by thread: Re: How to name variables in a program?
- Index(es):
Relevant Pages
|