Ruby Red

[ rakaur on Sat Sep 18 at 10:09 PM // category: programming, technology ]

Okay, so, I kind of added on to my last post and made it into a rant this morning. It still needs some work.

I finished the Python book I was reading. It’s a great (if a bit difficult) book to read if you already have programming experience.

So, I’ve moved on to the Ruby book. I’m still only a few pages/chapters/whatever into it, and it’s pretty weird. I mean, aside from the wacky syntax and Perlishless, it’s just pretty weird. Take the way it implements iterators for example. It associates code blocks with a method. That is, no code block is run within being tied into some sort of method (I think) and you can use the yield keyword (not the same yield as generators in Python) to “talk” to the code block it was called from. For example:

def someMethod
    yield
    yield
    yield
end

someMethod { puts "hello world" }

Will result in:

hello world
hello world
hello world

I’m not sure I completely understand this concept yet, but I realize it’s very powerful. I may not like Ruby very much yet, but I definitely respect it. I can realize already that I’m going to have extreme difficulty grasping the Japanese logic (Ruby is mostly Japanese, having originated and mostly displaced Python there) that comes along with it. It’s like using a TI calculator all your life then being forced to use a Casio. That’s the best example I can think of. I’m a retard.

Anyway.

-- rakaur // 2004.09.18 @ 10:09 PM


0 TrackBacks

Listed below are links to blogs that reference this entry.

TrackBack URL for this entry: http://mt.ericw.org/mt-tb.cgi/22


Leave a comment


Name:
Email:
URL:   
Remember personal info?