4 ms·
People with less experience consistently undervalue linting and code formatting and style. Code linting forces one to deal with code smells and innocuous errors
by rmk 6y ago
People with less experience consistently undervalue linting and code formatting and style. Code linting forces one to deal with code smells and innocuous errors that can cost a lot to fix once they escape into the field. Consistent code formatting and style are invaluable in (a) reducing cognitive load in picking names, which is a hard problem in computer science, (b) clarifying the structure of the code (you begin to see the forest for the trees, because the trees are mostly uniform) and (c) onboarding or familiarising with new codebases, including new areas of large codebases.
- bawolff 6y agoI like consistent code style (i dont care what as long as its consistent) but it has never helped me come up with good variable names.
- kenhwang 6y agoI value a consistent enough default style. I'm not going to waste time arguing why this specific consistent style is better that some other consistent style and I'm certainly not going to police the codebase manually and force it into that style. Either the linter catches it and fixes it automatically with little to no configuration, or its not important enough to be worth the time.
- nielsbot 6y agoOpinion: but I think "invaluable" is overstating it. I agree with OP: not that important. Again, opinion. (20 years experience here) Edit: I suppose I should clarify why. I think there are more important issues to focus on when building software with others.
- pindab0ter 6y agoI think there might be more agreement here than we think. OP is talking about “people who stress over […]”. I think a linter can be (in?)valuable without stressing over it. Just get everybody on board, don't stress over which style “is better” (as if there's such a thing) and make it your own.
- TheCoelacanth 6y agoI think the value is modest, but since the cost is essentially zero, it's a no-brainer to use it.
- lytefm 6y ago> (c) onboarding or familiarising with new codebases, including new areas of large codebases. It is extremely useful to lower the cognitive overhead when looking into different areas of the codebase. Inconsistent naming patterns, „magic” strings instead of enums, preferences about array iterations, using deprecated features etc shouldn't need to part of a code review if they can be detected automatically instead. This is especially useful for junior devs.