4 ms·
That only works if you're manually formatting the code, hard to imagine a deterministic rule for deciding when to compress, that won't disappoint people rather
by eternityforest 3y ago
That only works if you're manually formatting the code, hard to imagine a deterministic rule for deciding when to compress, that won't disappoint people rather often.
It's a bit too obscure. I can't imagine when I'd ever manually format.
- postpawl 3y agoYeah, having to change 2nd IF statement line just because you changed the conditions on the 1st IF statement seems like a big negative.
- eviks 3y agoThat's the beauty of flexibility - for those cases where beauty matters, it's reachable, but not forced upon anyone else I don't even find it that hard to imagine (I can even imagine multiple seamlessly integrated AI-suggested options generated based on your previously handcrafted examples), but agree with your underlying point that that's likely not going to happen given the state of tooling design across the board
- eternityforest 3y agoOnce someone uses a flexible feature, everyone else who works on the codebase has to deal with it too. Anyone who thinks of code as more of an implementation detail than a goal probably won't like not being able to just click auto format and forget it.
- eviks 3y agoSo what? It's not like pythonic whitespace prevents similar manual alignment incompatible with autoformat like if x=1... if y=2 So you still have to resolve the coding style conflict somehow
- eternityforest 3y agoYou can resolve it by choosing a standard style for the whole project and letting auto format do the rest. Maybe even auto rejecting commits that don't match it, like some projects do. You could of course do the same with a flexible language, but without manual formatting at least some part there's probably not going to be as much benefit. I guess you could say "auto format leaves braces alone" but then you don't have a fully machine executable style. Maybe you could have the auto format just always compact the braces, but that seems like encouraging dense one liners, most projects probably want to discourage that.
- eviks 3y agoYou can't resolve it because it's manual formatting that's not part of the auto format rules, that's the point! And this doesn't depend on braces vs whitespace, manual improvements are possible in either case, so your argument against {} vs space flexibility doesn't have the benefit of forcing machine executable style