Lonely Lion

Chris McAvoy likes kites

Chicago.pm Recap

without comments

I presented last night at the Chicago Perl Mongers meeting. The theme was introducing Perl people to some other languages. I think it went over pretty well. For each language, I talked a little bit about the basic syntax, library resources, and general community stuff. Then gave one “cool thing” that I think typically really makes a first looker’s eyes go wide. For Python it was list comprehensions, for Ruby it was blocks and adding methods to existing classes.

Python was a slam dunk demonstration wise, it makes sense to people. List comprehensions are so similar to map that it wasn’t really a conceptual leap. It was just something cool. Ruby was a harder sell. Opening up String and adding a is_cool? method got some good reactions, but the block concept just left a lot of heads shaking. Block usage seems sort of odd at first. I remember not really understanding how my_list.each {|i| puts i} is better than for i in my_list do. I explained that blocks are something you just use for a while, and then you realize that they sort of invert the way you think about simple things like iteration. I built a quick closure, thinking that would help, but it didn’t.

I’m giving this presentation again next month out in Wheaton. Anyone have an advice for how to better present blocks? I think it may very well be the sort of thing you don’t appreciate until you use them for a while, but it would be nice to have an example that really shook people up. Any advice is appreciated.

Written by Chris

February 21st, 2007 at 9:16 am

Posted in Blog,Perl,Python,Ruby

Switch to our mobile site