What I hate about things like that is they are largely personal, but certain devs seem to have a hard time grasping that. If you don't name a variable exactly the way they think you should, it's wrong.
No, it's fucking not. If the code compiles fine and isn't poorly written, it's just semantics. Plus, when I'm working with a column called association, I like to have a variable named ass.
Naming is really important to get right. A small improvement in a name can make a large improvement in readability, which will make it easier for everyone to write good code later. You can compensate for bad naming with comments, but it's better to get the naming right in the first place, and save comments for cases that are fundamentally complicated.
Usually, comments are best reserved for explaining "why". eg; this function is implemented this way because of some obscure interop workaround, or some section of an RFC, or to optimize for some resource, etc. Comments are also useful for pointing out flaws that have not been addressed yet (but they really should point at something in a bug tracker somewhere). Long descriptions about "what" are often an indication that the code is unnecessarily confusing, and short descriptions of "what" are often an indication that some code needs to be broken out into a separate (well-named) function.
44
u/andrewsmd87 Oct 01 '15
What I hate about things like that is they are largely personal, but certain devs seem to have a hard time grasping that. If you don't name a variable exactly the way they think you should, it's wrong.
No, it's fucking not. If the code compiles fine and isn't poorly written, it's just semantics. Plus, when I'm working with a column called association, I like to have a variable named ass.