3 ms·
I think that can be a dangerous mindset. Code readability isn't a trifling concern that you shouldn't care about in favour of more interesting things, it should
by ryanbrunner 6y ago
I think that can be a dangerous mindset. Code readability isn't a trifling concern that you shouldn't care about in favour of more interesting things, it should be your primary concern as a developer. In almost every circumstance, I'll prefer readable code to something that's more clever, or even more performant.
Rubocop and other linting tools do aid in readability somewhat, but I agree that a lot of the time they can either focus on trivial concerns that don't really make a large impact on readability (things like which quote characters to use), and in some cases actively harm readability (the examples from this article).
Personally, my feeling on tools like Rubocop is that where they break down is often more important than the areas where they help (high level structure and communicating intent), and often the benefits of consistency in syntax are frankly pretty marginal, but I can get people having different opinions on this. There's certainly Rubocop rules I enable and get value from, but I do have quite a lot turned off and don't really notice much impact from it.