DEV Community

Cover image for Redundancy in Ruby: Feature or Bug?
mzakzook
mzakzook

Posted on

2 1

Redundancy in Ruby: Feature or Bug?

The Ruby language came onto the scene in the mid 90’s thanks to a Yukihiro Matsumoto. He was a C++ programmer who wanted to have more fun programming and felt that most languages neglected the human experience of coding. He designed Ruby so that experienced programmers could jump in and immediately start writing powerful code.

To allow programmers from different origins to make sense of Ruby it seems Matsumoto felt it was best to create multiple methods to achieve the same goal, also known as method aliases.

For example, a C# programmer can jump over to Ruby and find parallels like the shared Array.Findall method. Whereas a SQL coder will be happy to find a familiar Array.Select method to achieve the same goal.

While it seems the redundancy allows for experienced programmers to make sense of Ruby faster, it also presents challenges for beginners. Is there a difference between Map & Collect? Reduce & Inject? Select & Findall? The list goes on...

I fall into the camp that believes that the redundancy allows for more freedom and should be appreciated. At its worst, it teaches beginners how to look up methods in Ruby docs and clarify questions that will continue to show up in other fashions as one learns to code.

Reference: https://en.m.wikipedia.org/wiki/Ruby_(programming_language)

Hostinger image

Get n8n VPS hosting 3x cheaper than a cloud solution

Get fast, easy, secure n8n VPS hosting from $4.99/mo at Hostinger. Automate any workflow using a pre-installed n8n application and no-code customization.

Start now

Top comments (0)

Billboard image

Create up to 10 Postgres Databases on Neon's free plan.

If you're starting a new project, Neon has got your databases covered. No credit cards. No trials. No getting in your way.

Try Neon for Free →

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay