4 ms·
In my experience a large project needs, at the very least: * Indenting consistent with the curly braces, and well enough defined that when you remove an outer
by michaelt 3y ago
In my experience a large project needs, at the very least:
* Indenting consistent with the curly braces, and well enough defined that when you remove an outer loop and want to unindent the code from that block, you don't have to do it by hand.
* A one-line code change doesn't bring with it a 500-line style change because the file passed between people with different style tastes.
Unfortunately, it's often difficult to achieve these modest desires without someone also wanting to limit line lengths, ban the ternary operator, ban nulls, and so on...
- anon291 3y ago> * A one-line code change doesn't bring with it a 500-line style change because the file passed between people with different style tastes. In general, one should refrain from drive-by refactoring.
- deleted 3y ago[deleted]
- threatofrain 3y agoJust use a style formatter and the debate is done. Everyone is unhappy now. Or very happy due to not arguing.
- mgaunard 3y agoIn my career the only people I saw arguing for auto style formatters are people that were simply unable to systematically follow simple rules, and that you're better off without.
- threatofrain 3y agoI'm afraid anyone who uses Tailwind is almost certainly using a style formatter to auto-arrange the CSS.
- vundercind 3y agoWhy in god’s name would programmers of all people resist letting computers handle “systematically [applying] simple rules” for us automatically?
- mgaunard 3y agoprogramming is about keeping control of the way the infrastructure operates
- vundercind 3y agoAre you also against makefiles, on the same grounds? “If they can’t be bothered to run each build step by hand, you probably don’t want them around anyway” That’s much closer to being “the way infrastructure operates” than formatting is. I suppose 100% of IAC is right out, then.
- mgaunard 3y agoSource code is something that you author; binary artifacts aren't.
- erik_seaberg 3y agoNaming and layout are part of how experts communicate intent with each other. Auto formatters are literally blind so they mostly make poorly motivated naming and layout decisions.
- vundercind 3y agoI would love some examples of this. I’ve yet to see a case in 20+ years of programming that was even close to being more-valuable than not having to think about formatting, but maybe it’s because none of the ten or so languages in which I’ve been paid to write code have been the sort where that’s a big deal. [edit] naming, yes. That’s important. Static types are enormously important—machine-checkable documentation is the best sort. Comments are excellent if names and types aren’t enough. Separate documentation if all of those fail. Where my braces go or tabs-v-spaces or what have you? Not so much, but again, maybe it’s because we write different languages.