5 ms·
I can't quite imagine what you mean by this, asking for clarification sorry if I come off wrong. Why is it a problem that you know who wrote the code by looking
by leecommamichael 3y ago
I can't quite imagine what you mean by this, asking for clarification sorry if I come off wrong. Why is it a problem that you know who wrote the code by looking at it? Do you mean that their style is distracting?
- kevinmchugh 3y agoRuby has "reduce" and "inject" aliased. Most developers pick one or the other. A codebase that mixes them adds cognitive load. It's not hard, but it adds a speed bump to understanding.
- ysavir 3y agoDoes it really, though? How much time do you actually lose to having to sometimes read "reduce" and sometimes read "inject"? I've heard these arguments a hundred times, and not once did I feel like the underlying sentiment was more than "I like/dislike X, therefor I want to limit how much other people can use X".
- kevinmchugh 3y agoI worked on a small team for years and the other person who was there that whole time was an inject guy. I'm a reduce guy. It's fine, we never tried to change each other, but I never got over the mental hump of "what does inject do? Oh right". This is for the smallest possible style difference. I agree that a lot of folks get hung up on their personal preferences and want to fight about. Linters reduce those fights, and encourage everybody to just deal with it.
- mrinterweb 3y agoI mean if someone has a particular style that others disagree on, the repo ends up with inconsistently styled code. There are benefits to consistently styled code especially when there are a lot of hands in the repo. I think teams should strive to have a mostly homogeneous code style for consistency sake. It makes reading code easier and ultimately maintaining code easier. Having a linter enforce style rules is really helpful so code reviews don't need to be consumed with tedious style discussions. I like rubocop because it can be configured to be as flexible or strict as the team wants. Let the team establish what the level of consistency they want is.