Amtrak series: Ruby on Rails on Rails

This will be the most technical of my posts in the Amtrak series, but it’s not just for computer geeks so stay with me. Here we go.

Ruby on Rails is a “web application framework”, a way for programmers to make web applications more easily and more quickly (and more enjoyably, as its creators would be quick to point out.) It was created by 37signals, the makers of Basecamp and other fine web apps, and has been one of the fastest growing programming environments of the last couple years. “Ruby” is the programming language and “Rails” is the set of additions that make it “fast” and “easy,” like a high-speed train. (Not a sight-seeing Amtrak.)

img_0088.jpg

You probably see where this is going. As an exercise in literalness, I though it would be interesting to do a little Ruby on Rails programming while on the train, or in other words, Ruby on Rails on Rails. (Mitch Hedberg said “I’d like to see a forklift lift a crate of forks. It’d be so…literal. ‘Hey, you’re using that machine for its exact purpose!’”) See the pictures.

I have not delved into Rails as much as my local colleagues, but with the little I’ve used it, I’ve been impressed. By taking away the tedious parts of programming, it really does make programming more enjoyable. I know several good developers who prefer it.

Ruby on Rails enforces an architecture called “Model-View-Controller” (MVC), which is used heavily in Mac applications and well written web applications. Though not built on Rails, WordPress also uses an MVC architecture. If you have a WordPress blog, you know you can easily change the theme of your blog. This is thanks to the modular MVC architecture with which it was written.

img_0096.jpg

Here’s where this applies to everyone: 37signals hasn’t only extracted Rails from their best programming practices, they’ve also extracted a book from their best business practices. I highly recommend Getting Real by 37signals, availably entirely for free on their website. They’ve given away their “cookbook” — what they’ve learned about marketing, project management, time management, hiring, agility, task prioritization, and more. I finished the book believing that small teams can do great things.

Amtrak series: Pick good metrics and stay on track, if it matters

As I mentioned, this weekend I came from Sacramento to Provo by Amtrak train. I flew to Sacramento on Southwest Airlines, buying a one-way ticket so I could decide later whether to depart from SAC or San Francisco. But at the last minute I instead decided to indulge my long time desire to ride a train. (I had long talked of hopping a train with my college roommate, but we never learned if it’s a misdemeanor or a felony and I didn’t think want to risk the latter.)

The ride took 21 hours, which afforded lots of time for reading, listening to music and talks, and taking pictures. I also met several people: a guy moving with everything he owned to start a new life in Denver, an artist-musician couple vacationing (the wife said Steve Case, founder of AOL, asked her to high school prom but she turned him down), and a guy from Wisconsin who’s been in the military for 24 years and thinks we should have gone to Darfur long ago. All very different and interesting stories.

The price for this trip, not including dinner in the dining car, was $74.00 or $3.52/hour. Compare that with my Southwest flight which cost a whopping $37.92/hour.

But when did the price per hour of a trip ever matter?

If you want to accomplish something, you must measure it:

If you don’t measure something, you can’t change it. The process of leadership is one of painting a vision, then saying how you’re going to get there, and then measuring whether you’re actually getting there. Otherwise, you risk only talking about great things but not accomplishing them. (Source: Mitt Romney)

I like the idea of using metrics to incent the right behavior. For example, “cars with realtime MPG usage displays tend to make people more efficient drivers.” (source, also) If you keep track of how often you read important books or go to the gym, or how meaningful your time is with your family (even in a subjective sense), those things are sure to improve over time. Pick your own metrics and stick to them.

More on metrics: High resolution mistakes by Seth Godin and Domino Rally business models by Paul Allen

So what could possible be meaningful about a trip with a low price per hour? That metric could only incentivize inefficient, slow-paced trips with no regard for urgency or schedule. Or in other words, I was just in this one for the ride.

Do you promise allegiance?

This week one of my Brazilian mission companions became a U.S. citizen. I attended his naturalization ceremony in downtown SLC, and though it wasn’t fancy, I found it to be a very patriotic event. Here’s how it went down:

“All rise”. Judge David Sam entered. United States District Court for the District of Utah was now in session. Girl scouts brought out the colors, led us in the Pledge of Allegiance, and then we sang the National Anthem.

Then 189 persons from 54 countries rose and repeated the following oath:

“I hereby declare, on oath, that I absolutely and entirely renounce and abjure all allegiance and fidelity to any foreign prince, potentate, state or sovereignty, of whom or which I have heretofore been a subject or citizen; that I will support and defend the Constitution and laws of the United States of America against all enemies, foreign and domestic; that I will bear true faith and allegiance to the same; that I will bear arms on behalf of the United States when required by the law; that I will perform noncombatant service in the armed forces of the United States when required by the law; that I will perform work of national importance under civilian direction when required by the law; and that I take this obligation freely without any mental reservation or purpose of evasion; so help me God.” (via. see also.)

These 189 foreign-born persons were now American citizens, “just as American,” in Judge Sam’s words, “as any direct descendent of the Founding Fathers.”

Judge Sam let several people in the group stand and offer a few remarks about becoming U.S. citizens. A man from Mexico stood and said how thankful he was for economic opportunities, freedom of religion, and schools. A Muslim woman from Bosnia said she was thankful to be able to practice her religion and wear a veil (hijab). A man from Peru said “we can do anything here” and “we must love this country.” An El Salvadorian said “this is a promised land for everybody.” And a Venezuelan said “I’ve been American at heart for a long time.”

Judge Sam said his own parents were immigrants from Romania, saving and sacrificing to come to America. They changed their last name to Sam (like Uncle Sam) on arrival. Judge Sam then told the new citizens:

I am your servant. It is my duty and responsibility to see that you are treated equally. One of my favorite comments was from a Somalian man a few years ago. He said “If I were to become a German citizen, I’d still never be German. If I were to become a Russian citizen, I’d still never be Russian. But today I am an American.”

Freedom isn’t free. It will slip away if we don’t protect it. It needs to be protected by all who enjoy it. Let freedom ring in your life. Understand the blessings of freedom. Be law-abiding, God-fearing citizens. God bless the U.S. and all of you.

New citizens renounce allegiance to their country of birth and promise to support and defend the Constitution of the United States. If you were born in the United States, you don’t take the formal oath. But do you promise the same?