Sinatra is super
Posted in ruby, sinatra on March 27th, 2009 by mdwWell my first sinatra app and it took one day to write. It’s trivial and useless, but was just a joy to write nevertheless. If rails is an armored tank then sinatra is a dirt bike. Good watching: screencast by @bmizerany covering some of the main topics.
Anyway to share some joy, let me say I love that there are no controllers, no helpers, no routes file, etc. Rails has so much stuff I always feel like I’m spending a lot of time jumping around between files. Actually a lot of that is due to my trying to learn the latest edge rails feature, try a new plugin, install some new gem, refactor a bit of awfulness from last month, and oh yeah, actually try to add some new feature. So here it’s all straightforward and so there’s nothing to do but write code, no distractions. I learned a couple neat things, like using “pass” to mimic rails’ before_filter functionality.
I also decided to give HAML a try on this experiment as well, and it gets a rave review too. Drop dead easy to learn the basics in 5 minutes, and it puts out such clean markup compared to erb that I’m gonna use it in other projects. Who knew templating could be this good?
Been so long since I made a pie at home, so I bought the basic ingredients. I used the ready-made dough from the grocery, reluctantly, but it sure saves a lot of work. All I needed beyond this was a good mozzarella, some tomatoes, basil. Everything else is optional, but I went for pepperoni, pesto sauce and mushrooms.