On 4/30/06, chiaro scuro <kiaroskuro / gmail.com> wrote:
> bad-hungarian is when you prefix a variable name with type information
> eg:
>
>   fWidth = fSize
>
> the 'f' simply means float.  you can see you have type compatibilty on both
> sides, but it doesn't say anything about semantic compatibility. fWidth
> could be used as a measure in metres, whereas fSize is expressed in feet!
>
> good-hungarian is when you prefix a variable name with semantic information
>
>    metric_width = feet_size
>
> you can see immediately that there is a problem there.  both variables are
> of the same type (Float), yet they have a different meaning.

This is a good point, but I would hesitate to call that hungarian
notation. If it looked like this:

  mWidth = fSize

Where the m = "metric" and f = "feet", then you could claim hungarian
notation. And if it *did* look like that, I'd campaign in favor of
expanding the prefix. Including "metric_" in the variable name isn't
hungarian notation, it's just a meaningful variable name, and no one
will vote against that.

Jacob Fugal