6.03.2011

Ruby

I'm currently learning Ruby for a talk i'm doing with some student mates in several weeks. The talk itself is about Ruby on Rails (here we go again, my beloved "web development"...) but I'll do the technical part - learning the language, coding an example webpage etc... Not sure what the englisch book name is, but what I'm currently reading is a nice and direct introduction to Ruby's syntax and functionality. I can remember me sitting in front of an old CRT monitor, barely able to even write a C main function and trying to cope with Ruby and it's horrible Scite editor. I didn't knew anything about it, but they told it's easy to learn and so on. In truth, I didn't understand a thing. Freshly from RPGMaker and used to simple BASIC-like commands, you just couldn't tell me that is a variable and a class and a loop and whatever else... Didn't understand and dropped it. Now, years later after Ruby became some kind of "new web tech blabla", I understand everything what's written in this book. The problem with script and highlevel languages is that they use concepts a completely fresh programmer won't know of - even if the book tries to teach you it. However, it many really good ideas like negative indices for reverse index access, additional operators like the <=> for giving back a range between -1 and +1 depending on value comparison, multiple variable on an assignment statement etc... Tiny things, but these bring a bit of... trust. Yes, trust! Trust and hope that it has more of those nice, tiny things and also the naturally builtin hash support. I'm quite a syntax fetishist and now why I learned to like C more than basic. Though Ruby supports some imho a bit too varied possibilities of calling functions and grouping code, I'd currently describe it as "awesome garbage". "Crazy" in the sense of that there are actually useful features that don't into the Java areas of syntax and "garbage" cause it's not very useful apart from scripting and a bit doubtful in certain choices of syntactical freedom (means there are some hard to read but possible constructs aka "print unless evenxy" and such - weeeeird!). However, it IS a scripting language and doesn't even try to pseudo compile like Java or so. That makes it better by default - better stay close to the spirit of ya offspring medium.

So maybe I'll keep it in mind as a quick "need to test this" or "that screams for a script" language I could also use later. Yeah, I'm looking forward to it. There is a reason why I read books like that. It didn't work with LISP (besides the fact that there are millions of completely different implementations), but maybe it works with Ruby.

No comments: