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 is correct (born from my previous question ):

I tend to not use third-party gems (at least when it is possible and reasonable), because they can be left at any time. Also, if the Ruby on Rails structure changes, I may have to wait for these gems to update before updating my application to the latest version of RoR.

+4
source share
5 answers

In an ideal world where you are immortal, have infinite time, are the best programmer in the world, and it doesnโ€™t matter if you run your product in 1 hour or 10 years so that you can encode everything yourself from scratch, and then maybe meaning to avoid other people's code.

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

A good rule of thumb is to prefer your favorite / popular community stones for this solution when you can. The more people use the gem, the more people are interested in updating it, and the more eyeballs carefully study it and send requests for traction. Most likely, a stone tested by a group of people under production conditions is better than what you came up with on your first attempt, right?

Gems that depend on one supporting hobby that donโ€™t even use it in a self-monitoring app is where you tend to find a certain risk. But even in such situations, if you end up having to shell out your gem, you are still ahead, where you would be if you started from scratch.

The best trend is to avoid writing everything from scratch and instead use the brains of other people with similar needs.

+12
source

Well, this is a risk that you take in exchange for an economical development time / budget and a shorter time to market.

If you find yourself in a situation where one of your stones is abandoned, you can look at such gems or a fork and improve it. In any case, this is still better than developing everything yourself.

+4
source

Drop this philosophy! Many websites / companies tend to do this - this is better known in the "Not Invented Here" syndrome. Twitter in particular is a big offender. Open source is great - use it.

+1
source

The work is perfectly completed only when nothing can be added to it and nothing can be removed. - Joseph Joubert

In the same philosophy, we follow our Rails projects at work. If you want to add a gem to the Gemfile, you basically have to argue it. If you cannot find a good reason why he should be there, he will be released. We are definitely not trying to invent a wheel, but the number of potentially poorly supported moving parts down is IMHO - a good choice. So say yes to the well-maintained and installed Rails plugins, but be careful about things that look like a quick fix. More often than not, you wonโ€™t be able to save your own patches or unlock the repo, so you could reinvent this particular wheel ...

+1
source

For example, try to develop a gem, and then realize your functions yourself. This way you can define your own vision of the problem.

I prefer to use all the gems that I found useful. If after updating any stone does not work, you can always unlock it and update it.

0
source

Source: https://habr.com/ru/post/918945/


All Articles