Mentally and Environmentally RoR and ASP.NET are similar. I don’t mean technically though. Some approaches and thoughts are the same, and there are many many differences. These are a few of my experiences on starting to learn RoR and remembering my learning of ASP.NET as well.
I had a personal project I came up with to help me learn and remember Japanese. It is something that I haven’t seen before so would have been a fun project I could easily knock out in a weekend on ASP.NET, is fairly basic idea. However, someone challenged me to try to do it in Ruby on Rails, so I figured what the heck why not.
A little background on me is I like ASP.NET and it is my preferred framework, but I am open to doing things in other projects which is why I am decent with php as well. Ruby on Rails is something I have wanted to take a look at, but just haven’t taken the leap until now.
Digging Into My Experience
First, thing I did was try to get some legs on doing RoR. I know that I am a very visual learner when it comes to trying new things so I went to lynda.com and got the Ruby on Rails essentials videos and watched through the first couple of hours of the videos.
I have to say that it was a great introduction. While they were using an older out of date version of rails it was enough to get me started so I set out to start working on my app.
First hurdle was figuring out sqlite. I have never done anything with sqlite at all so I had to quickly get up to speed on this and fortunately it was easy. I find doing this a big nicer default over SQL Express, but nice to see a portable way to do db stuff. Also of note a more flat file type system is coming to .NET world so more mobility in development is going to be available.
If you talk to a few developers I know there is one thing I don’t like and that is code generation, I prefer to lean on a well written framework. I just plain don’t like generated code so I was happy to see that the script/generate stuff mostly just generated files and methods, no real code.
One thing I love about ASP.NET development is I don’t need to run IIS locally and have some big app running in the background to view my sites I can just used the built-in web server cassini, and sometime soon IIS express. Happily RoR uses a “built-in” server, I prefer mongrel over webrick.
Ruby took a little getting used to, but I tend to like it. I much prefer it over PHP and can say if I have any future projects where ASP.NET doesn’t fit I will move to RoR first over PHP. Ruby just looks so much better as a dynamic language than PHP so it makes coding easier and more consistent. A good well organized language is another reason I like C#/ASP.NET.
Much like learning anything else learning new things can be a bit tricky at first until you get used to it. I feel pretty confident with my ASP.NET skills, but it took a lot to get there. RoR is the same thing.
RAD is Fairly Useless
Much like ASP.NET RoR’s RAD is great for examples and trying to show the “power” of a framework. However, once you dig into it flaws tend to show up when you start relying on all the RAD code generated. I quickly hit this wall when I wanted to do a few specific things and couldn’t, this might also be my lack of knowledge on a few conventions.
ASP.NET is similar with its controls. There is a bit of use for them, but anything past the basics it is time to hang them up and get to some real work and good code architecture that is why I prefer ASP.NET MVC it is easier to work with.
Too Many Conventions
The “power” that is offered by convention over configuration is enormous and can offer some real speedups when it comes to developing in rails, I can see that. However, good documentation of these conventions are very sparse and confusing leaving me constantly confused by things that should seem fairly simple.
A specific example is path helpers and routing. I have, yet, to find anything that goes into more details than what scaffolding shows about setting up a route mapping so I can do edit_object_path(@object) in a link_to method in one of my views. While it “works” like it should there are conventions behind all of it I can’t seem to figure out, yet, making things not work right, so it leaves me using uglier solutions that are brittle.
Barrier to Entry
This is the key area that RoR is similar to ASP.NET and I could be totally wrong about it only using RoR for 1 week. Both seem to be easy at first, but things quickly get more complicated until you figure out more about what is going on in the framework, and the proper way to do things.
In this case RoR has one thing going for it, for me. I am not trying to learn a new language, a framework, plus a web framework all at once. I have good experience with MVC using ASP.NET MVC and CodeIgniter on PHP.
Much like ASP.NET/.NET world documentation is too advanced, most of the time, when it even exists in RoR world. There isn’t enough stupid people examples of how to do things. The benefit of PHP world is its the first thing a lot of new developers learn so there is an abundance of beginner, beginnermediate, and intermediate examples of things allowing people to grow a little more easily.
Conclusion / Next
This is meant as a chronicle of my experience doing RoR development so I am obviously going to misunderstand and do things wrong, but for now RoR feels like a big hill to climb like ASP.NET used to be. The key thing is I need to learn how things are done in the ruby/ruby on rails world to make life a bit easier. I am used to the .NET world so time to get used the Ruby world too.
I had planned to post on how I got my environment setup for doing RoR development using 2.3.8, but seeing as how RoR 3.0
should be coming out soonjust released I will hold off and start over from scratch on it and get a bit more technical in future posts.