Before adding any utility gem to the project, try to search for alternatives, and be sure that you chose a minimal solution – one that still has developer support and a community contributing to it. It is also useful to browse through curated “awesome” lists.

Be aware! Don’t be gem obsessed! Most of the time, you can write the code on your own, without any gems. Your own code is much easier to customize, polish, and build into your architecture. It does only what it is supposed to do, with no ballast.

If you do decide to use a gem, look at the code inside it and try to understand what it does, and how it is implemented. A lot of gem links provided in this guide show you the most popular solution (which is usually not the simplest solution) and examples of simpler, better solutions for the topic. Investigating other people’s open source code gives you a few advantages:

  • you can learn how to do something from other good coders
  • you don’t need documentation for the gem (if the code is clear), as you can see the public interface and usage logic
  • or you discover that the gem is so bad and unoptimized that you definitely need to throw it away, and write your own implementation (and you already know at least one way NOT to do it)