My updates have been a little scarce, but I’ve been programming– I promise.
I recently have been working on a site, discountcampusbooks.com (psst, buy your books there!) with my husband, alan.dipert.org. The book search is written in Ruby and uses the incredibly cute Ruby framework, Sinatra. I absolutely LOVE Sinatra, and I think for me it is a viable alternative to Rails. I’ve had pretty mixed feelings on ROR lately. I know I am a bit too opinionated for my skill level, but I really have something to say about the differences and advantages of both Rails and Sinatra.
I should say this first, because I feel like it:
For someone like me, who is just learning their first programming language, new to object orientation, and incredibly naive about the power or lack thereof of a given language, I feel blessed to have picked Ruby as my first language to learn. As I have learned Ruby, I’ve also learned the shortcomings of other languages. I am lucky enough to have a multilingual husband who keeps books like toilet paper in our bathroom, so at any given point I can pick up a little reading material and learn a little Clojure (yeah!!) or C (not so much). I’ve explored Python and Haskell pretty thoroughly as well as a few other common programming languages. I can’t argue against any of these languages too much. Why would I? Mostly, as I learn more about other languages, I just feel luckier to have picked Ruby as my devirginizing language.
I also know it is important to explore the value of other languages. In fact, I know I sometimes need other languages to make the best use of Ruby. There is so much to say about all of this. End interjection (for now.)
The biggest issue for me, as I mentioned earlier, is the fact that ROR is the largest use/implementation of Ruby and the easiest for which you can find tutorials, screencasts, support groups, chatrooms, etc etc. Overwhelmed by ROR, I started using a “joke” (literally) framework my friend wrote to get my Ruby programs off the command line and on the web. After dealing with the shortcomings of his babyframework (again, it was written as a “joke” and was actually put together as a way to use Ruby as if it were PHP), I started branching out on my own. It became clear to me that, though you can use Ruby in a similar way to PHP using ERB, it’s not necessarily the best way. I had been working on a dungeon text adventure in Ruby and I was trying to figure out how to make it work via the web using ERB. I was, for the most part, successful. My tech support was limited, but I started to see the parallels of his framework and Sinatra after checking out Sinatra earlier in the week. Enter Sinatra. Things like Rack ran on both the joke framework and Sinatra. I could even use shotgun to run a webserver on my computer. WHOA. All of these things were exposed to me in small doses, and then adding Sinatra to the mix just blew my mind further. Ruby is fuckin’ cool. Noted. And I continued to compute.
When my husband asked me to help with the book search, I was pretty excited. I was so excited to see an actual implementation of a Sinatra-based web app. There was so much Ruby involved!!
During my first experience with rails, I was hardly able to figure out where I should even put my Ruby.
Weeks earlier, I had spent time creating a ’sample blog’ in rails, and figuring out the MVC framework. In rails, so much of the work is done for you. A large part of the process is accepting MVC framework, also seen in zend and django in PHP and python, respectively. You don’t need to be a Ruby expert to do Rails. (But you can be, and you will be better for your knowledge, that’s for sure. I have never doubted that.) Likewise, I truly believe you could suck at Rails and excel at Ruby. In fact, you’d probably prefer and have already used Sinatra if this is the case. They are not mutually inclusive. One of my favorite things about Ruby is the power and extensiveness of the language. Frameworks as light as Sinatra give creative freedom and your exposure to Ruby and the web can be vast or minimal– you can most likely get something to work for you. If you want something big, you’ll have to build it yourself. On the other hand, larger frameworks provide you an out of the box, large-scale solution that subsequently requires more knowledge and familiarity of the framework before you can customize it creatively.
Sinatra allows you a very simple, lightweight framework that requires you build off your own knowledge rather than, as my friend Julio would put it, David’s skills. Honestly, if you know the scope of your site will be huge, you know your DB infrastructure, and you’ve been through all of this before, Rails is probably your answer. From what I hear, you’ll love it, and it’s worth learning the MVC framework aspects that may be, at first, completely fuckin’ confusing (for me, it’s slowly coming along after using Sinatra more). However, if you’re like me, and you wanna start from small potatoes and build it yourself (yeah!!), use Sinatra. I feel like I may be making my way towards Rails, but I may also never get there. I enjoy the freedom of Sinatra, and I’m not building any gigantic web applications for the time being. Sinatra just rules if you love Ruby, but Rails seems to big and Ruby command line programs aren’t GUI enough. The web is an excellent agnostic platform for development. So embrace it. I have noticed many programmers are reluctant to do so for various reasons, but Sinatra has opened my eyes to the fact that you can write painless, creative Ruby apps with a little hassle and a lot of fun.
Cheers