Getting Locomotive chugging

I’d like to learn enough programming to satisfy my inner geek, even though I’m never going to be a coder. I have a project in mind which might be a useful tutorial. Nothing too complicated, but the end result involves HTML, forms, and a database. So I figured my lack of programming knowledge might be turned to good use: I can choose any language I want.

Joel and Tim point out gaps in many programmers’ bag of tricks, and suggest that those gaps are growing through the teaching of “easy” languages. I’m not trying to make my living as a programmer. This is simply messing around on a rainy day(s), so I don’t have to worry about anything but the tools fitting the job. Which, it’s true, is what the links above are saying, too, but their focus is on the higher end of the scale here. So I won’t worry about C, Lisp, or even Java at this point.

As I’m swimming in the Web 2.0 froth (and liking Backpackit), I decided Ruby on Rails would be my testbed.

Several hours later…

I understand programming logic (the basics). I know how computers work. Still, configuration, installation, and development environments frustrate me to no end. What I want to do is write a program, and see if it works, and then iterate back over it. The more time I can spend at an editor versus the command line, the better shape I’ll be. The syntax for variables, arrays, and the like can be learned by just keeping at it (or so I tell myself).

Anyway, in my effort to avoid configuration and hours of set-up time, I downloaded Locomotive, as it promised to bundle everything together. Then I downloaded the BBEdit language module for Ruby (file) so I wouldn’t have any syntax coloring excuses.

Cazy part about Locomotive, which just went to 1.0, and unapologetically has no application help was that the screencast (QuickTime) was the most useful tutorial I could find. I ended up going back and forth in the screencast to check my work and learning where I had gone astray.

Hardest part was the database. Locomotive comes with SQLite to ease the pain, but the default database.yml file in Locomotive 1.0 has info for MySQL and PostgreSQL, too. You need to remove that if you’re using SQLite. And the screencast is not from Locomotive 1.0, so there are some differences (but no real distinctions). Overall, Locomotive was a boon in this process, but it’s still not easy.

The last piece in my set-up process was finally resolved when I realized my chosen table name was (mistakenly) in the singular, instead of the plural.

For the magic of ActiveRecord to work, you must name your database tables and columns according to specific rules. For example, when you create a table, Rails wants it to be plural. Not story, but stories. (Really Getting Started in Rails – thanks!)

I got a (tiny) bit further than the screencast itself, and then I realized how much I have to learn, both about Ruby and about how to model my database. The lengthy holiday break comes to an end tomorrow morning, so this project may drag out over weeks or months, depending on how many ‘aha’ moments I find time for.