1 May 2006 01:11
Re: how to use curly brackets vs. 'end' in Ruby
chiaro scuro <kiaroskuro <at> gmail.com>
2006-04-30 23:11:02 GMT
2006-04-30 23:11:02 GMT
I certainly cannot disagree with that!(Continue reading)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. I would argue that in ruby -using duck typing- we use good hungarian quite a lot. On 5/1/06, Stuart Stegall <stuart <at> footworkmedia.com> wrote: > > So Hungarian Notation = Bad, Hungarian Women = Good. Did I get that > right? > chiaro scuro wrote: > > ah! but not may know that there are both bad-hungarian and > > good-hungarian !
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.
I would argue that in ruby -using duck typing- we use good hungarian quite a
lot.
On 5/1/06, Stuart Stegall <stuart <at> footworkmedia.com> wrote:
>
> So Hungarian Notation = Bad, Hungarian Women = Good. Did I get that
> right?
> chiaro scuro wrote:
> > ah! but not may know that there are both bad-hungarian and
> > good-hungarian !
RSS Feed