Ups and Downs are common when learning new things and Week 3 proves to be another down turn. I came out of week 1 confused and alone in the world, but week 2 lead me to to heights with help from a pro. I learned a lot and felt invincible until jQuery shot me through the heart, and destroyed me for a couple of days. Then I took a step further and was curios about using Azure Storage with Ruby on Rails. I promptly died.
My Approach to Ruby
My Approach to learning Ruby, until now, has been to learn what is required to make websites. Over time, I figured, I would learn Ruby. I have since realized while this approach has worked so far; it is time to bite the bullet and get down to learning the language.
What is quite interesting is how much of the language you don’t really use when doing fairly basic CRUD web sites, which frankly is a lot of sites these days. If you want to do more advanced “stuff” with rails beyond what is required so that your code can look and function better you can actually dig more into the Ruby language, but you really don’t need to. Trying to figure out Azure with RoR is what drove home this point to me with a brutal force.
I realize that as technology moves on; Cloud computing is here and here to stay. I have a feeling it is going to be like learning how to do database interactions, it is just something you learn to be a well rounded developer. As such I have chosen to learn Windows Azure since it is what I know about the most and is platform independent as a storage service with rest, and hosting platform*.
Since Azure is my cloud of choice it was time for hunting down the “how” of using azure storage, which is what I am after most. At first I was trying to figure out a rails specific way to do Azure storage using ActiveResource. However, lack of knowledge when it comes to REST itself was a limiting factor on using Azure Storage.
A couple of days later I give google another shot and pretty much accidentally found a ruby gem, waz-storage, being excited as I was I downloaded it took a look at the source code to find out “how” this gem worked and quickly realized I didn’t understand what was going on because of my severe lack of knowledge about the Ruby language.
Beyond that though it is really nice that there is a gem for doing Azure interactions instead of having to learn how to do it raw from the get-go. This is really going to be a good launching board to learning Ruby better. Plus the benefit of having a ruby gem/library for doing azure “stuff” means I don’t have to be bound to rails when interacting with Azure Storage, I can write background processes.
For a good slide deck about Ruby on Rails with Windows Azure take a look at:
Building Ruby on Rails apps on Windows Azure (MIX 2010 at Last Vegas)
jQuery on Rails
The problem I ran into was, again, with REST url’s, but this time everything worked in CRUD except deleting. I couldn’t actually delete anything. For the life of me the problem just couldn’t be solved. I setup an example app and did a scaffold for some example of deletion code. I copied the link_to helper line, and it didn’t work. I couldn’t figure it out since it was the exact same code just replacing the object reference.
It was an eye opening week. I realized, again, I have more to learn, but have a path to follow. Another cool thing is that there are a lot of resources available and most likely there is already a gem for something I need, such as interacting with azure. I am going to take some time and get back to the basics and start learning the language a bit better so I can know what is going on. I am even thinking about trying to write down some correlations between what C# does and what Ruby does so I can better understand it.
Also I want to note if you are learning RoR and want to break out of the very basics make sure you pay attention to what is going on because it isn’t necessarily as cut and dry as people make it sound. Just be careful out there and have fun learning.
*When I say Windows Azure is a platform independent hosting solution I mean that it can run anything that windows server can run, which is most everything. Like all technologies there are caveats.