3 ms·
I find it odd that this isn’t a configuration option in any/all language compilers. I prefer indents to braces, but understand the hate others have. Turns out A
by hsbauauvhabzb 4y ago
I find it odd that this isn’t a configuration option in any/all language compilers. I prefer indents to braces, but understand the hate others have. Turns out AST engines could convert them relatively easily.
- p1necone 4y agoA lot of languages do have auto formatters with opinionated defaults for this. For go, gofmt is so opinionated that you can't even configure it, which is kinda cool because it means all go code that uses it will look the same. There's also rustfmt for rust and prettier for JS/TS (and I assume similar for lots of other languages I'm not familiar with), both of which are configurable, which I prefer - but I can see the upsides of a one-size-fits-all code formatting tool (especially for a language like go where a reasonably constrained feature set/syntax is an explicit goal of the language).
- occamrazor 4y agoPython has black, also not configurable.
- avryhof 4y agoBlack is pretty nice with the defaults, but it certainly is configurable these days. It can take command line options, or it can be configured in your Poetry pyproject.toml file. https://black.readthedocs.io/en/stable/usage_and_configuration/the_basics.html https://black.readthedocs.io/en/stable/usage_and_configurati...