Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is it right to avoid using third-party gems?

I am using Ruby on Rails 3.2.2. and I would like to know if the following thought (born from my previous question) is correct:

I tend not to use third-party gems (at least when it is possible and reasonable) because they might be abandoned at any time. Also, if the Ruby on Rails framework changes, I might have to wait for those gems to be updated before updating my application to the latest RoR version.

like image 440
user12882 Avatar asked Dec 02 '22 22:12

user12882


2 Answers

In a perfect world where you're immortal, have infinite time, are the world's best programmer, and it makes no difference whether you launch your product in 1 hour or 10 years so you can code everything yourself from scratch, then maybe it makes more sense to avoid the code of other people.

But in the real world, people have solved problems for you already. And gems allow you to plug in those solutions.

A good rule of thumb is to prefer the community's favorite/popular gems for a given solution when you can. The more people using a gem, the more people have an interest in keeping it updated and the more eyeballs are scrutinizing it and sending pull requests. Chances are that a gem that's battle-tested by a bunch of people in production environments is better than what you'd come up with on your first attempt, right?

Gems that depend on one hobbyist maintainer that's not even using it in a self-itch-scratching production application are where you tend to find some risk. But even in those situations, if you end up having to fork his gem one day, you're still ahead of where you'd be if you started from scratch.

A better tendency is to avoid writing everything from scratch and instead leverage the brains of other people with similar needs.

like image 123
danneu Avatar answered Dec 08 '22 00:12

danneu


Well, it's the risk you're taking in exchange for saved development time/budget and shorter time-to-market.

If you find yourself in a situation when one of your gems is abandoned, then you could look at similar gems or fork and improve that one. Either way, it's still better than developing everything by yourself.

like image 20
Sergio Tulentsev Avatar answered Dec 07 '22 22:12

Sergio Tulentsev