Search code examples
ruby-on-railsrubygemssimple-formformtastic

What is the benefit of using a gem rather than building from scratch? (specifically simple form / formtastic)


I am learning rails (Rails 4) and in the course of building my app, I come across a lot of gems that make things "easier". There is a part of me that thinks this feels like "cheating" and that I ought to learn the way to build my app the way I want to without using shortcuts....or using as few shortcuts (gems) as possible. I recognize that some gems must be used (rails_12factor, spring, pg) and some are really hard to make from scratch (devise)...but others (Simple Form, Formtastic), I don't really see the point of if you have the time to build the functionality from scratch.

If you have unlimited time to learn, what is the benefit of using a gem like Simple Form or Formtastic? Besides perhaps someday working with legacy code that uses these gems?

My instinct is that it is better to learn the long way first and then be more informed about when to use gems .... but SO MANY people recommend simple form I wonder if I'm missing some other benefit besides speed.


Solution

  • Using gems:

    • (+) Faster to implement
    • (+) (In most cases) You'll get the result of the collaboration of several people
    • (-) Sometimes you may need only a part of what the gem does
    • (-) Gem dependencies etc. could cause problems with other gems or rails versions

    Making it yourself:

    • (+) You know exactly what you're getting
    • (+) You'll learn
    • (-) Slower to implement

    Anyways, the best option of all would be too see if you can take a gem and customize it the way that suits you. However, as you said, at start, for the purpose of learning, I figure you'd get the best value by making it yourself.

    Does anyone have anything else to add?