You can only get so far into Ruby on Rails before you have to expand beyond just RoR. There are so many tools and methods of doing things you can’t help needing to dig into the ruby world to better understand. That is exactly what I have been doing this last week. Please feel free to keep reading as I go through what I have learned about the rubyverse.
First thing I did this week was continue my exploration of the ruby language. Call it a fault or a benefit, but the whole time I was exploring more of the ruby language I couldn’t help but to compare it to C#, the language I am most comfortable with. This spawned a series of posts that are up and coming which I will be dubbing, C# vs Ruby.
The first post coming up is on methods in ruby. I have to say there are some really cool syntax sugar elements to ruby, but dynamic languages still make me nervous. The “other” dynamic language I have used for doing web development has left a really sour taste in my mouth for dynamic languages in general. I think part of the reason was because I saw so much bad code and unorganized code, with no rhyme or reason behind some what I saw, it was hard to figure out what was going on. Sometimes code would randomly work that didn’t seem like it should at all.
Fortunately, the ruby world seems to be organized. The language is very well thought out and planned, unlike “other” languages. The coolest part about digging into ruby code is it seems most ruby developers I run across know what they are doing and leverage the ruby language well, especially those that break out of RoR. This leads to a lot of fun looking through ruby code since most people seem to use good design and care about how their code looks and works.
Azure with Waz-Storage
In my last post, Week 3 on RoR, I mentioned that my cloud of choice is Azure. Since that is the case I need to start working with it, which I did. Most of what I did was test code to see how things worked, and if they worked. I have to say it was some exciting code testing because waz-storage gem works. I need to do a lot more testing, but I have had good results so far except for one thing.
The problem I have run across with the waz-storage gem is when I go to retrieve a list of the containers, it can. However, when I try to retrieve an individual container it doesn’t work well. The only instance I could get it to work was if the waz-storage gem created a container it could then retrieve it. If the containers were created by another tool it just gets a nil result. I have submitted the issue to be reviewed and it is being reviewed. Until then there shouldn’t be a problem as long as I just use the ruby app to work with the container it created, which is a fine workaround for now.
Along the journey to learning RoR I have come across Sinatra. I keep hearing it referred to over and over and over again. So I decided to take a look and take a read at what it is. What I can tell is that it is a lower level web framework than RoR is. So why is this useful? Well as best as I can tell it is simple to learn so most useful for simple websites. Those things that exist as static, but need to be maintained as simply as possible. The cool thing is how low level and freeform you can get writing your web app. Sometimes apps don’t need MVC so this is a good fitting web framework.
The couple of times I have thought about what it takes to create a web framework from the ground up have always ended in not knowing how to deal with HTTP request and responses. Networking, and anything relating to it, is one of those things I just don’t know or understand very well. Rack actually makes all that HTTP stuff easy to deal with. It is actually really cool since it is a layer between the web framework and the web server. In fact you can build your own web framework on top of it if you want. Sinatra and RoR both use rack for their HTTP request response layer. Learning Rack even without the thought of using it personally is a good idea so if something comes up you have a better idea of how RoR and Sinatra work.
There are a lot of things I have yet to read and understand. The top two things I still need to learn are rubygems and rake. Both things are very big in doing RoR development. The biggest thing about learning rubygems is that it is so ingrained into ruby development not knowing it is like trying to drive without a steering wheel. I have a feeling that this first excursion in the great beyond that is the rubyverse wont be my last one. Now to figure out how to get some more time in the day so I can learn it all.