3 ms·
Ruby 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 spee
by kevinmchugh 3y ago
Ruby 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.