Every time I use one of these it ends up doing ridiculous things to the formatting, like splitting what should really be 1 line over 4 or 5. Which completely destroys whole-file readability/scanability. Does nobody else find it really hard to read codebases subject to these formatters?
The formatter that set the expectation of standard formatting was that for Go (gofmt), which applies a very light touch: it never removes newlines and rarely inserts them, so you still have latitude to arrange the code in a way that respects its meaning.
By contrast, the Java formatter we use at Google is an example of the totalitarian instincts unleashed by this new technology: it insists on reflowing everything, including the contents of comments so that they always use the full 100 columns. Madness.
There are always corner cases. For example, clang-format at $day_job doesn't understand semantically that I want my 4x4 matrix constant to be formatted as 4 rows with 4 numbers each; putting all 16 numbers in a single long array will get a lower score.
But as a whole, I found it easier to navigate the monolithic code base when most of it has been auto-formatted, exceptions aside. When applying a formatter to existing code, I usually do that in a separate commit and then follow it with any hand-rewritten lines afterwards (in case either the formatter or my changes afterwards accidentally regress something).
And once the formatter is enabled by default, it's usually easy enough to come up with a set of smaller statements that auto-format well to replace a longer statement that auto-formats poorly.
> For example, clang-format at $day_job doesn't understand semantically that I want my 4x4 matrix constant to be formatted as 4 rows with 4 numbers each
I've developed a habit of refactoring long lines early (e.g. breaking large expressions and assigning to intermediary variables) to prevent the formatter from adding hard-to-read mid-expression line breaks
Interesting.. not having to worry about where to break long lines and letting the formatter (in my case Prettier) figure it all out for me has been one of the most wonderful things in recent memory that has happened to my programming experience. I can just write awful looking code at the speed of thought and know it will turn out fine when I hit save.
Having to switch back to a non-opinionated non-line-breaking formatter like golang's makes me very sad.
Prettier outputs fairly decent formatting for code that is already reasonable to begin with. It's not so great when you have things like template strings with large expressions in the interpolation slots.
It depends for me on the formatter. For me, blank lines are often part of how I express meaning. If the formatter is good at respecting my chosen line breaks, fantastic. If not, it's pistols at dawn.