Here’s where we get into the weird, stressful scrunchy part of the term, where there’s too much to do and not enough time to do it. Ever heard that phrase, ‘Robbing Peter to pay Paul?” Sorry Ruby, but you’re Peter this week. Not as much movement on the Ruby front as I would have liked.

The good news? Only 1.5 weeks left of the evil, life-sucking online classes. By the way, if you’re ever thinking of taking two of them at once–I don’t recommend it. However, I’m going to be a VERY happy camper in about 9 days when my work load decreases by 70%.

I did manage to squeeze in my scheduled tutorial this week: Conditional Statements and Loops. Yeah it seems basic, but I’ll appreciate this later when I’m (hopefully) not pulling my hair out wondering why my code doesn’t work over some weird Ruby syntax issue.

And there are a couple of either ‘gotcha’s’ especially for the PHP and Javascript inclined.

For example:

A typical PHP switch statement might go like so:

switch (variable) {
case 'value':
# do stuff...
break;
default:
# do default stuff...
break;
}

The Ruby version would be:

message = case
when hour < 12
"Good morning"
when hour > 12 && hour < 17
"Good afternoon"
else
"Good evening"
end

Or, for an even more ‘English’ looking effect, the same thing could be written:

when hour < 12 then "Good morning"
when hour > 12 && hour < 17 then "Good afternoon"
else "Good evening"
end

Kinda makes you glad you don’t have to put your program on punch cards don’t it?

I also have an official project repo up on Github, though there’s nothing in it but a template at the moment. We had a lot of useful information thrown at this week, and I’m looking forward to sifting through it to see just which parts I’ll be able to apply.