Tuesday, October 14, 2014

MakerSquare Day 34: The hard way first (8/1)

First, I've been bad about holding my blogging time to 15 minutes, so I'm back to setting an alarm. So let's see what I can tell you about the Monday of our eighth week in only 15 minutes. (It's so interesting to me how 15 minutes can seem like an eternity--if, say, you're waiting for a bus--or like no time at all if you're trying to get something done.)

(Speaking of buses, I decided not to wait for one last night, and on the walk home, I saw a fox running along the street, which means that I really made the right decision. Have I told you how much I like most animals in the Canidae form? I guess that doesn't really have much place in a coding blog. Unless I can somehow come up with a dog-related coding project...)

Many weeks ago, we learned how to use PostgreSQL to create and access database tables. Which meant that, on top of learning Ruby, we had big chunks of this other language in our code. Then we were introduced to Active Record, which is--ok, this gets a little jargony, but here goes--an ORM (object-relational mapping), or, in less-jargony form: Active Record is a way to write Ruby that will talk to your database in whatever language that database likes to talk.

I've said it before, but Active Record is kind of magical and cool (for at least some value of cool); and the topic was introduced to us with,
"Now that we made you learn PostgreSQL, we're going to teach you this easier way to do things, and you're going to hate us for making you do it the hard way first."
But I really didn't. It was hard to start with PSQL, but doing things the hard way first means that (a) you appreciate the magic of the easy way and (b) you understand what's going on under the hood.

I thought of that yesterday after our first day of Rails. Have you seen Rails? It's kind of amazing how Rails does so much for you. So after weeks of hand-producing files slowly and carefully, now I just type "rails new <Project_name>" and everything appears as if by magic. Which is great and amazing--but I'm still glad that we did it the hard way first, so I can understand what's happening.

No comments:

Post a Comment