in reply to Of variable {mice} and its name {man}.
Coming from Java, i used to name my variables like employeeRecord and thingWithNoName, but now i stick to the convention of using all lower case and separating words with the underscore - thing_with_no_name. This also keeps me from chosing long names since i hate reaching for the underscore key. ;)
When confronted with mental block on finding a good name, if i can't think of one in 5 minutes or less, i will pick something and move on. Leaving a comment that promises to rename the variable reminds me of why i did so. I really feel that names are important, but not so important as to get stuck in rut over them. This is similar to listening to someone's conversation when they pause for far too long trying to find the right word, completely losing their train of thought.
Final comment - plurals. tye finally convinced me to avoid using plurals for arrays and hashes, because they already indicate a colletion: @file, @line, %record. This keeps me from guessing between $file and @file, $record and %record. This is also a new practice for me, so i sometimes forget.
jeffa
Consistency is golden
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: (jeffa) Re: Of variable {mice} and its name {man}.
by vladb (Vicar) on Jun 01, 2002 at 14:51 UTC |