Update: It's time to get going on the March contest.
Well, as we close up the January contest, it's time to get a new one started. Same rules, you enter by writing a blog post responding to the question below, and linking to it in the comments section. At the end of the February, Peter Cooper (the author of Beginning Ruby: From Novice to Professional, head of Ruby Inside, and this month's guest judge), Jason Gilmore (the Apress Editor), and I will take a week to pick our favorite and announce it. The winner will win three Apress books of their choice.
With that in mind, let's move right on to this month's question:
Last month Jarkko Laine asked "How has Ruby on Rails made you a better programmer?" This month I want to ask, "How has Ruby blown or stretched your mind?" Initially you might think the same answer applies as to Jarkko's question, but what I am specifically referring to are the things in Ruby that have made your brain race and go "wow!", even if you've never bothered to go on to use that feature much (if at all!)
Most Ruby programmers have come to the language from another. I came from Perl, which had already blown my mind with its development style, having previously come from the monolithic, strict worlds of Pascal and C. At each language transition, I have initially resisted and refused to look at the new programming language with an open mind, instead comparing it to my current language. Transitions are hard, especially when you're invested many years in your current techniques, but even though it can take a real effort to start on something new, especially a programming language, I've found that once those "Wow!" moments start coming along, you rapidly become a convert.
What were your "Wow!" moments with Ruby? Do you still get them? Are you just intellectually impressed when they come along, or do you actually become truly excited (keep it clean please)? What were the moments and the things that you saw that made you want to give your first-born to Matz and live in Ruby land happily ever after?
To kick things off, I will shortly be blogging my own answer to this question (although I won't be eligible for the contest, naturally!) but I look forward to getting to see what it is that's made you excited about Ruby, especially if I get to experience some new "Wow!" moments I haven't had before!
And while you head off to write you masterpiece, I'll be off reading through a stack of great entries from last week's contest.
Like, totally "wow" man! This is some strong stuff. It'll blow your mind. Like, jumping foxes eating chunky bacon on a field of ruby's.
ReplyDelete(blogger doesn't accept pre tags)
class Hasheesh
def fly_away
puts "weeeeeeeeeeee, I can, like, fly!!!"
end
def illegal?
return true
end
end
class Dude
def self.legalize_dis_stuff(stuff)
stuff.instance_eval %q{
def illegal?
puts "'no worries man"
return false
end
}
end
def self.legalize_all_da_stuff(stuff)
stuff.class.class_eval %q{
def illegal?
puts "no way maaaan"
return false
end
}
end
end
h = Hasheesh.new
h.illegal? #=> true
Dude.legalize_dis_stuff(h)
h.illegal? #=> false
m = Hasheesh.new
m.illegal? #=> true
Dude.legalize_all_da_stuff(m)
Hasheesh.new.illegal? #=> false
(blogger doesn't accept pre tags)
Taking a class from somewhere else, evaluating it, and deciding it needs new or modified functionality at runtime is mind blowing. You can literally do anything! Pass around packets of functionality and mix and match as needed.
Far out man.
Shalev,
ReplyDeletedon't forget to post your entry on your blog, and put a link to it here.
I'd love to see that as a blog entry, but I kinda sense he's taking the piss ;-)
ReplyDeleteI blogged briefly about Iterators.
ReplyDeleteI got a free moment today for once, so I'll go ahead and knock this out. :)
ReplyDeletehttp://mrneighborly.com/articles/2007/02/02/dynamic-meta-seduction-how-ruby-wowed-and-wooed-me-to-the-dark-side
http://borasky-research.blogspot.com/2007/02/how-ruby-has-changed-way-i-program.html
ReplyDeleteHere's my entry about closures
ReplyDeleteHere's my entry: Mind blowing Ruby
ReplyDeleteAlright mates. I've done as requested and blogged this. Had to set up a blog first, but it was about time anyway.
ReplyDeleteRuby... Like... Wow!
For me the blow-my mind Ruby features are:
ReplyDelete- first of all (as probably for many others) - blocks.
Its a totally cool feature man ...
I came to Ruby from BASIC -> Turbo Pascal -> UNIX and DOS C -> Java -> Python (and liked and still like all of them - yeah - even BASIC! its good to whack some quick code up in ..., though I hardly use it nowadays). I don't know of any such feature in those languages, though there may be - I'm not a language lawyer, just a fan ...
- open classes are pretty good feature too.
- really like attr_accessor and its ilk too; the ability to call getters and setters as though they're fields of an object shortens code ...
- and last but not least, "everything in Ruby is an object" is a great one as well.
Vasudev Ram
www.dancingbison.com
Something on Ruby code blocks here -
ReplyDeletehttp://rubylearning.com/blog/2007/02/05/how-has-ruby-blown-my-mind/
Vasudev,
ReplyDeleteIf you're trying to enter the contest, please write your answer at your own blog and link to it from here.
> Vasudev, if you're entering the contest ...
ReplyDeleteSorry, Pat, missed that earlier.
Done now - my entry is here:
http://jugad.livejournal.com/2007/02/05/
Vasudev
I mistyped the URL for my entry on closures. It is http://darwinweb.net/article/Ruby_Blocks_As_Closures
ReplyDelete>Vasudev,
ReplyDeleteIf you're trying to enter the contest, please write your answer at
Sorry, done now:
My entry
Vasudev
Boom! Ow.
ReplyDeletehttp://philomousos.blogspot.com/2007/02/how-has-ruby-blown-your-mind.html
Since I've finally finished mine I can read the other's entered. :)
ReplyDeletehttp://blog.adegansoftware.com/2007/02/07/how-has-ruby-blown-or-stretched-my-mind/
Chris
A language feature? It's bigger than that. It's an attitude:
ReplyDeleteProgramming as if People Mattered
So my entry is more a teaching entry that shows some of the mind blowing ruby features that I encountered, that I decided to enter:
ReplyDeletehttp://concentrationstudios.com/2007/2/11/enumerable-saving-your-life
Ahh, you're gonna like this one:
ReplyDeletehttp://class-self.blogspot.com/2007/02/story-of-ruby-and-how-it-has-blown-my.html
My entry: I believe in Ruby.
ReplyDeleteFor the fun of it, here's my entry:
ReplyDeleteRuby is brighter than the sun to me! :-)
http://www.ralip.com.br/jp/blog/post?p=ruby-is-brighter-than-the-sun-to-me
Cheers,
Joao
My offering: Ruby, yoga for your brain
ReplyDeleteI learned ruby last week and here's my entry Brave New Ruby World
ReplyDeleteI'm late to the party, but here's my response just the same.
ReplyDelete