5 ms·
Formatters can also readily spot and preserve patterns if you want them. You can shape the cost function to value patterns. I suspect Walter formed this opinio
by mhh__ 3y ago
Formatters can also readily spot and preserve patterns if you want them. You can shape the cost function to value patterns.
I suspect Walter formed this opinion when they were much worse.
Also formatters have enormous benefit when you have lots of people in the same project. It almost doesn't even matter what the format is as long as it's efficient IMO.
- Lutger 3y agoExactly. Walter Bright also used to be a lone hero - he isn't anymore. But some habits stick of course. Also the languages he writes in might not have the best formatters. I am old enough to have experienced the not so good formatters (in mainstream languages) and wasn't a fan. But after working with really great formatters, its such a benefit I don't like to go without it anymore.
- whstl 3y agoI can see his point. I'm also perfectly fine with programming without a linter/formatter for personal projects or bigger projects where quality is more important than speed. The code doesn't look worse. In fact it might end up better. But for corporate teams, doing web dev? It is definitely necessary, unless you want to spend days reviewing trivialities, or you're ok with the code looking like a patchwork quilt of styles.
- brabel 3y agoThe quality of the formatter is extremely important. Using a bad formatter is such a bad experience that I would agree it may be better to not use it... but modern languages have this problem mostly solved (not so sure about D)... the example in the post would still be broken up in multiple lines because almost all formatters will avoid having multiple "statements" in a single line, for good reason. But as with any tool: you can probably improve it, for example, to keep this exact "pattern" if you really like it... I wonder if there are formatters that are powerful enough to allow this sort of customization.