The plugin system of Sequel and Roda

submited by
Style Pass
2023-01-31 08:00:06

When developing gems, often one of the difficult problems to solve is creating a good ratio between simplicity, convenience and flexibility.

A simple gem is easy to understand, both in public interface and internal implementation. This gem is usually more focused and tries not to do too much. It often has less LOC and little or no dependencies, which means it loads faster and uses less memory.

A convenient gem comes with many features out-of-the-box which cover common scenarios, so that users don’t have to reimplement them over and over again.

By definition simplicity and convenience are inversely proportional; in order to achieve convenience (by adding features) you have to sacrifice some simplicity, and vice versa. On top of that your gem also needs to be flexible, which is more difficult to achieve the more features it has.

By using standard gem design, it’s usually impossible to achieve a perfect ratio that will suit everyone. Almost always you will have a group of people which are missing features X/Y/Z and will turn to another more featureful gem, or you will have a group which thinks your gem does too much and will turn to a simpler gem. That’s why there is the division between Rails and Sinatra, because for some people Rails is too bloated, while for other people Sinatra is too simple.

Leave a Comment