DEV Community

Discussion on: When Alternatives are Unhelpful: A Ruby Case Study

Collapse
 
scarsrcool10 profile image
Jonathan Cleghorn • Edited

Using a good linter with strict rules agreed upon by your team can help a lot with this. I specifically referring to Rubocop for Ruby ofc. If you have access to RubyMine, its really good at just picking up these rules. That being said, you're right. Ruby (my language of choice) is pretty riddled with examples of this. Alias method are another example. Inject vs Reduce is the first example that pops into my head.

Collapse
 
shalvah profile image
Shalvah

Yes! inject vs reduce caught me out too. The first time I saw inject, I thought it was for an entirely different purpose (especially with the way it was explained). Took me a long time to realise it was the same. Alias methods can really be the devil.