2 ms·
The semantic formatting seems better to me, but I feel like I'll get used to almost any reasonable formatting. If you spend enough time with a consistently form
by bjterry 6y ago
The semantic formatting seems better to me, but I feel like I'll get used to almost any reasonable formatting. If you spend enough time with a consistently formatted codebase, your eye will be drawn to the important parts when you review code. In a tiny way, you develop "expertise" with the formatting, and when you look at other code there is an ever-so-subtle friction to understanding it. Manually reindenting code after editing or refactoring it is also pretty annoying, though of course that's the instinct that "code is meant to be read" is intended to argue against.
It's interesting that the creator of Rubocop isn't that bullish on Prettier, because my company literally uses Rubocop to replicate a Prettier-like experience [1]. Rubocop makes a totally decent Prettier replacement, with the right rules. Another advantage of using a separate opinionated formatting tool is that you avoid issues with a diversity of editors which never quite have the same auto-indentation to mess up code diffs.
1: https://flexport.engineering/approximating-prettier-for-ruby-with-rubocop-8b863bd64dc6 https://flexport.engineering/approximating-prettier-for-ruby...