Time for week 2. About 2 weeks ago I was able to sit down with a Rails expert from work. I figured I have too many compound questions to try to start asking on forums that I would have confused myself and gotten very lost in what was going on.
One of the big problems I had with doing rails from Week 1 on RoR was the problem of too many conventions. This was the main thing I wanted solved. I wanted to trying to flesh out all the rails and ruby’isms that existed which where holding me back. Surprisingly enough there really wasn’t all that much from a technical stand point.
What We Did
I have a personal project I am working on to help my learning of Japanese, and found that I was running into a lot of problems with it, mostly little things. So we decided to sit down at a coffee shop for a couple of hours, turned out to be 4, and rewrote my base app from scratch using Rails 3.0, talk about cool.
However, we did the project with a twist. One of the things I also wanted to do was to do TDD/BDD to do it. While this did take more time to do I feel it really helped to cover many more bases of rails and get much more comfortable using it. I learned how to setup cucumber and use the bundle system for dependencies. Also we coded up the app normally then converted it over to STI, single table inheritance, which was really cool and my app was a perfect fit for it. The BDD tests really helped us know when we got it converted properly.
Here is a list of things we covered in about 4 hours.
- RESTful Routes
- Single Table Inheritance
- Models to Help format db data
- BDD with Cucumber
- Pickle for data in our tests
- Code Organization
- Bundle’s (Gemfile)
I most likely left a couple of things out, but to cover all that in a matter of 4 hours was amazing. I think this speaks to the strength of doing TDD/BDD in forcing you to look at all of your project and making sure it works well together. The biggest thing I had a hard time with though was the REST and using it along with routes and the link_to helper in the views. I am going to make a specific post on this later, mostly so it can help me remember.
Why Am I Abandoning ASP.NET for RoR?
I was asked this question by a person at my school and the short answer is:
The biggest reason I started learning RoR is as a challenge from a friend and because it seemed kind of fun to learn something new. I am finally feeling comfortable with my programming abilities to venture out beyond my core language and framework of C#/.NET, and being successful at it.
I am also getting up to speed with RoR to be more marketable. At work they have hired a couple of RoR developers and it seems a couple of more future projects are going to be in RoR so I figure I should learn it; partially because I am a support a person and so I can jump into code if needed. Also it was a good idea to learn just to know in case a project I am working on in the future is a good fit for it, and so I can avoid php more.
I think if you are going to take a plunge into rails and you aren’t a newbie to programming find an expert in rails and asked to spend a couple of hours coding out a basic application which touches many parts of rails. I think this will help more than anything else. While I started with some very out of date videos and about died of boredom through parts of it I think spending time with an expert for 4 hours I learned as much if not more, and it stuck more.
p.s. I know it has been longer than 2 weeks since my last post, but all this information is based on my second week of learning.