4 ms·
I like to be somewhat verbose with my naming. I don't like to abbreviate unless its a very common and well understood abbreviation. If nothing else because I ca
by ryanelkins 17y ago
I like to be somewhat verbose with my naming. I don't like to abbreviate unless its a very common and well understood abbreviation. If nothing else because I can have a terrible memory and find myself struggling to remember exactly what a variable is storing otherwise. I can't imagine what it would be like for a different programmer entirely.
Perhaps I've just had to work with too much code that has poorly (in my opinion) named variables.
Then again I also have intellisense and autocomplete so I don't really fear a slightly longish variable name if it makes sense.
- abstractbill 17y agoI do this too, and I use Emacs's autocomplete to write almost everything. Another good reason is that I use search to navigate through files, and verbose names are easier to search for.
- rsclarke 17y agoI do not like long variable names and believe it is a combination of good commenting and inference through the code, that one should understand the role of the variable. I was taught camel case for everything, which I don't agree with. Camel case for class names, everything else lower case, short and separated with underscores if needed. Collections are plural, e.g addresses, so that one can be generic in iteration and talk of an 'address'.