sábado, 20 de noviembre de 2010

I'm a LOL programmer (wannabie)



In my new job, it seems I'll be writing ruby (on rails).

I've been trying the language in my spare time, and it seems a fairly good compromise between Perl and Smalltalk.

Except a couple of features or idioms I saw, everything else was quite intuitive or easy to understand (at least coming from Perl/Smalltalk).

+ Sigils do exist, but denote scope oposed to type.
+ __DATA__
+ '=' can be part of a method name. And there's some magic involved there. def method=(attr) can be used as an assignment (sintactically) as parens are optional.
+ Integer class can be expanded or subclassed.

Here are the codes I wrote to grasp the language. These are the usual examples I write in every language I try to learn:

- a program to center paragraphs.
- guessing number
- Network with hosts that pass messages one to the other.



Here is a link that I found useful about ruby patterns and idioms.
http://scriptlandia.blogspot.com/2009/02/design-patterns-in-ruby.html

1 comentario:

williJB dijo...

Al final no es tan dolors el change no? A més si pots fer servir un llenguatge que és mix entre dos d'aquests tan freaks que utilitzes doncs WIN-WIN