|
I disagree that there's no positive effect. A difference in code styles can introduce cognitive load, though naturally the actual effect will depend on the individuals involved, and the actual differences (for some, I agree it could be a non-issue). > Hopefully, you feel as passionately as I do about your own stylistic choices. My approach works best for me; but, it's not for everyone. And, clearly, other people's choices don't thrill me. It's a completely subjective matter. I do not. I do have preferences, but I'll let them go quickly in favour of following a standard convention for a given project. I care more about consistency than my own subjective opinions on code style. I would agree that manual code style checking is painful. I've previously used jslint, eslint, tslint, etc. and I always forgot to run it locally, and then get frustrated when it inevitably failed during CI. There's tooling to address that (syntax highlighting in editors, git hooks, etc.) but it doesn't completely alleviate the problem. Personally, I quickly adapted and the initial friction of adjusting my workflow (and co-workers theirs) meant a more consistent code base. I was pretty happy with that. Lately, I've been using Prettier.js that runs on save, and frankly I think it's fantastic. I don't always agree with the specific format it's chosen, and there's at least a few things it doesn't handle (e.g. superfluous new lines), but for the most part I no longer need to think about what my code looks like (stylistically, anyway). A lot less cognitive load, more consistent code base. |