4 ms·
So what's the upside for you with Sinatra? I'm embarrassed to having been doing Ruby for 8 years and never touching it. Just never saw the need - Rails in API m
by weatherlite 5y ago
So what's the upside for you with Sinatra? I'm embarrassed to having been doing Ruby for 8 years and never touching it. Just never saw the need - Rails in API mode seems adequate.
- vidarh 5y agoSinatra is small (the main part is about 2k lines). That's the main upside and/or downside depending on your philosophy. As someone who likes to know what goes on, I love Sinatra, but Sinatra does force you to pull in other code as needed yourself - you don't get handheld the way you do with Rails. If you need the kitchen-sink you might as well use Rails. But often you might need only a tiny fraction, and Sinatra is small enough to read. If you need a "halfway house" between Sinatra and Rails, Padrino layers nicely on top of Sinatra and you can pick and choose which parts of Padrino you want to use. My preferred stack is Sinatra + Sequel as the ORM, but if I need something "quick and dirty" I might throw Padrino on top as it's lightweight and unopinionated enough it doesn't get in my face the way Rails does. The caveat is that if your team is used to Rails chances are they'll hate you if you make them use Sinatra and they don't share a dislike for big frameworks.
- jamesgeck0 5y agoSinatra and the Camping microframework were an enormous help for me when I first started learning Ruby. Being able to read a minimal implementation of routing (for example) helped dispel a lot of the magic that I got hung up on in Rails.