Tuesday, July 31, 2012

PHP sounds terrible

I came to this programming thing totally fresh, and dove in with JavaScript. It was fun, but then I received the advice to scratch that and move onto Ruby. Reading a little bit of the history of Ruby, I'm discovering that its users are passionately in love with their language. If I enjoyed learning JavaScript, that's nothing compared to how inspired I feel by Ruby.

But I'd like to know the flip side of this, too. I'm glad I played with a tiny bit of JavaScript so I have a basis for comparison. This article condemning PHP is long, but really interesting to read. It makes Ruby sound like the breath of fresh air that developers have been waiting for. I'm a person who learns empirically, so it's difficult to take others' word for it - I'm kind of tempted to learn PHP just so I can experience its failings for myself. But that's a little counterintuitive, right? I'm going to focus on Ruby, and then if I figure out how to live forever, I can learn other languages just to make fun of them.

who can alex date?

Big ups to Alex on this fun exercise. It starts to show you the vast difference between a novice and a professional.

So this guy spits out some code at me:

and it works! Okay, I'm kind of in awe. I threw in a bunch of numbers to test it - even some creepy numbers! Because we all want to know who 97-year-olds can date.


1.9.3-p194 :001 > load "alexdating.rb"
 => true
1.9.3-p194 :002 > ideal_age(33)
 => 23
1.9.3-p194 :003 > ideal_age(43)
 => 28
1.9.3-p194 :004 > ideal_age(97)
 => 55
1.9.3-p194 :005 > ideal_age(4)
 => 9


Monday, July 30, 2012

I am very excited to learn that this: => is called a "rocket."
That's almost as amazing as a ! being called a "bang."

i am sworn to carry your burdens

I'm learning Ruby by making Skyrim jokes to myself. Oh, Lydia. Sorry I got you killed.