Sinatra is a Ruby low-level micro-framework.
What is a framework? Glad you asked!
A software framework is an abstraction in which software providing generic functionality can be selectively changed by additional user-written code, thus providing application-specific software. A software framework provides a standard way to build and deploy applications.
https://en.wikipedia.org/wiki/Software_framework
Sinatra, as a framework, lets you CRUD within a RESTful structure, thus Creating, Reading, Updating, and Deleting data via a web browser. It does this through standardized RESTful conventions like GET and POST. With Sinatra, you can make things like a simple website, blog, or barebones content management system.
As our mod geared up towards Sinatra, some peers from earlier mods I’ve spoken to described this little framework with a slight tinge of disdain, as in “Eww, you’re going to start using Sinatra”. And any time someone made an icky face about Sinatra to a noob like myself, it reminded me of the album cover for Frank’s seminal work “No One Cares”, a collection of heart-brake and love-struck songs depicting how even a staple like Sinatra himself, also gets no love.
I couldn’t help correlating lonely Frank and the relationship some programmers might share with Sinatra versus Rails.
But despite said pity party, lets take a look at some statistics showing how Sinatra actually holds it's own in the framework field.
Sinatra's usage is only a mere 95% less than Rails in 2016, but that means it’s being used by 5% of the Ruby framework market and that’s not a negligible number in any market. More so, it ranks 73rd place in Ruby Gem usage in 2018. Not bad considering there are at total 152,505 gems available.
This goes to show that Sinatra is a robust little tool, and therefore when comparing it with Ruby, would be more suited toward something like the below image:
Here lies the importance of getting comfortable with Sinatra before jumping into larger frameworks. When your hardware store is closed or your power tools are broken, having a deeply rooted skillset to solve challenges (because you’ve solved them with a simpler tool like a foldable knife) is crucial.
Beyond that, it also helps you understand and thus deeply appreciate a framework like Rails. Having a good base of experience with Sinatra will allow you to program better with larger, more complex tools. It will help you find solutions to bugs and challenges you'll hit in the future.
Lastly, Sinatra is ideal for projects that don't require all the bells and whistles Rails provides. Sometimes you don't need an 18v lithium powered cordless hammer drill/driver, a pocket knife will do.
Using Sinatra, through its simplicity, may even evoke the words of this Amazon reviewer for “No One Cares”,
Frank is so good that he can put you in the mood whether you were in that mood to begin with or not.”
Check out this awesome long list of apps, tools, and websites using Sinatra.
Top comments (0)