On May 4, 2011, at 9:34 AM, mP wrote:
>> You don't realize it, but you just used Hungarian Notation. With the names
>> you just chose, you will be able to quickly read code that uses these
>> variables and immediately notice if something is wrong, such as:
>>
>>> if (fileName.exists()) { ... }
>>
>>> You don't need an IDE to tell you something is wrong here, thanks to
>>> Hungarian Notation.
>>
>> Ok but this isn't the standard definition of HN.. this is naming things for
>> what they are and on that point, we are in deadly agreement.
>>
>> Kirk
>
> Not quite the "file" in "fileName" is hungarian notation its denoting
> its the String is actually a file's name. While probably unnecessary
> it is probably done because too many times String is used rather than
> an actual type such as FileName.
Very good point! Indeed String is used as a connivance when many times it
shouldn't be. If FileName where a class then instances would be.. logFileName
and so on....
Kirk
--
You received this message because you are subscribed to the Google Groups "The
Java Posse" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/javaposse?hl=en.