Sunday, December 17, 2006

Rails late nights

It was time to reread the Agile book from last year and go at it again. I went through the Depot Application, had it working, every step seemed very simple to follow and I could get the Depot running fairly easily. It took me the better part of a weekend, but it was running. The problem was, I did not get how some of the stuff worked.

I mean, it made sense in writing, but when I typed the code I did not know if I was typing a string variable, a method, or whatever. Everything looks the same pretty much. And I had never used hashes and arrays so much. Finally I realized that I just had to get used to the idea that all this nesting in hashes is the Rails way and Ruby way and I had to get used to follow it.

Then I picked up the Ruby for Rails book, and the Pickaxe Book and tried to read them cover to cover. That took a while. I would find myself dosing off at times (all this BTW happens late into the night, which is the only time I have found to devote to this).

After those two books, it was time to write my own application. It was a lot harder to get going. Don't get me wrong, I can write web applications, I have just used 4D which is a procedural language and Dreamweaver. Writing stuff in an MVC setup, with a language you hardly know and a framework that you know even less, it was slow going.

Not that I could not get the tables, the screens, the CRUD stuff. All that worked OK. But my apps need roles and rights, authentication, mailers, redirection, cron job processing, and all the view stuff needed (how do you get a popup with list values from a table in the database? for example).

But I kept going slowly making sense of what to use when. It had been a while since I had been so challenged with a language. And everyone out there keeps saying that this stuff is super easy. Do not be fooled. Sure complexity is masked and relegated far away from the app development, but sooner or later, you need to know where to look if something is not working. That was the part I struggled with, where would I go to see how things happened.

Anyway, the point of this post is to encourage all newbies out there to stick it out. It is not easy getting going with Rails, IF you want to build real, complex apps. You need to know Ruby, you need to understand Rails, and the way Rails wants you to do things.

No comments: