Home
entries friends calendar user info my FriendFeed feed
Soundtrack to Larry
The San Diego Years: 2006–?

Advertisement

Add to Memories
Tell a Friend

I think I've successfully stomped a bug in Perl's YAML module that's about 5 years old.

Maybe I can do this crap after all.

(Finding someone to pay me to do this crap, that's another story.)

Tags: ,

Add to Memories
Tell a Friend

So I'm still learning Ruby. I managed to get the latest edition of "The PickAxe" (official title: Programming Ruby) from the King County Public Library, who were willing to go the extra mile and get this newest edition through an inter-library loan (unlike the Seattle Public Library, who thought I'd be satisfied with the first edition despite the fact I specifically requested the second—nuts to them).

So as I was reading through the acknowledgements, I found the name Sean Russell. And I said to myself, "not the Sean Russell?" That name probably means nothing to almost everyone reading this, but he's an old high-school friend of mine, and in fact he and another friend of mine all sat together at our graduation ceremony.

So I did a little Google research, and sure enough, it's the same guy. So I dropped him a line to say hi. I was particularly amused by something he posts on his home page called the BushMeter, written using Ruby and SVG, that charts out President Bush's approval ratings over the entire course of his presidency.

Tags: , , , , , , ,

Add to Memories
Tell a Friend

High geek content ahead. Potentially inflammatory, but not intended as such.

I'm reading up on Ruby (admittedly egged on by the prevailing hype around Ruby on Rails). As an alternative to Perl, my current language of choice, it seems more palatable than Python to me. It's object-oriented from the ground up, unlike Perl which simulates OO through slightly contorted and easily ignored procedural conventions. Yet Ruby borrows just enough from Perl for me to feel comfortable easing myself into it—for example, it borrows Perl's powerful regular-expression syntax, and it will even permit some procedural style. It doesn't leave me feeling as disoriented as I remember Python did.

But there are at least a couple of pitfalls for dyed-in-the-wool Perl programmers like me. Return values of 0 or an empty string are regarded as Boolean true, whereas Perl treats them as false. Its syntax also has completely different meanings for some symbols than Perl's, for example $ (Perl scalar vs. Ruby global) and @ (Perl array vs. Ruby object instance variable).

Still, despite borrowing a lot of ideas from other programming languages, it feels very simple and less like a "kitchen sink" to me.

P.S. (5:44 p.m.): Silly me, I forgot one other big gotcha for Perl programmers switching to Ruby. Perl automagically converts numeric data from string form to integer form and vice-versa, depending on the context in which they're used. Ruby does not. So if you have a variable n that contains the string "20", and you try to evaluate n * 5, Perl would return 100, but Ruby returns the string "2020202020". To get the expected result in Ruby, you have to explicitly convert the string first (n.to_i * 5).

Tags: , , , ,

profile
Larry "The Al Pacino of Analogy" Gilbert
User: [info]l2g
Name: Larry "The Al Pacino of Analogy" Gilbert
calendar
Back June 2009
123456
78910111213
14151617181920
21222324252627
282930
links
Thought for the day
You need trepanation like you need another hole in your head.
page summary
tags

Advertisement

Customize