“ruby”
3 posts under this tag.
As I said on a previous post, I believe Spanish, my mother tongue, has a low status on the web. And as I laid there pondering the subjectivity of my assessment, I remembered Mihaly CsikszentmihalyiWP’s fascinating account of how (and why) he became a scientist (it appears in John Brockman’s excellent Curious MindsAM, a compilation of similar tales by top-notch scientists and a sure recommendation to anyone).
The particular anecdote that came to mind was when he and a friend quarrelled over whose neigborhood was the more communist (the matter was relevant because he was living in Italy and the country was then in political turmoil). Their brilliant analytic idea to try to settle the question was to count out the circulation of the left- and right-leaning newspapers in each of their neighborhoods’s newsstands. This of course sent them into all sorts of interesting statistical considerations, but it put them on the path of finding the subtle answers to their question, and it was certainly better than “the hocus-pocus most adults rely on to bolster their arguments”.
So I want to try to do something similar with my question—what is the linguistic vitality in the web of 14 languages?—and this post will be the beginning of my investigation. For reasons of practicality and personal bias, the 14 languages I’m going to settle to are: EnglishWP, GermanWP, FrenchWP, PolishWP, JapaneseWP, DutchWP, ItalianWP, SwedishWP, PortugueseWP, SpanishWP, FarsiWP, ChineseWP, EsperantoWP, and HindiWP.
Unlike most people these days, I happened to chance upon Rails through Ruby, not the other way round. But wait, today’s reading is a tad geeky but I’m putting it up here for non-geeks to read it —particularly those, you know who you are, that don’t yet speak any computer language— so here’s some context: Rails is a tool (a web framework they call it) to make web-apps (that’s right, a meta-tool: a tool to make tools) and Ruby is the computer language in which Rails is written.
Anyway, I can’t remember how I found Ruby but I can tell you when I was certain it was something truly special: when I found Programming Ruby: The Pragmatic Programmer’s Guide and, shortly thereafter, Why’s (Poignant) Guide to Ruby. The first one is a most delightful, witty, unique manual of the language made out of of an acute bout of ruby-rapture and given away for free by its freakishly talented authors; the second is the exact same thing.
So, after much ado, here’s today’s reading: the first chapter of Why The Lucky Stiff’s poignant guide, Kon’nichi wa, Ruby . Technophobists worry not, this chapter doesn’t contain a line of computer code nor does it force you to install a thing, it’s just good ole prose. It is my Trojan horse to try to get you to learn Ruby (you gotta learn a computer language someday). In fact, I’m so confident in my wooden stallion that let’s do this: you only need to read the very first section (1. Opening This Book) of the chapter. If it doesn’t mesmerize you, if you don’t have the weirdest crooked grin on your face by it’s end, feel under no obligation to read any further.
Since Javascript 1.2 and later there has been a cool and very powerful literal syntax for functions:
var sum = function(x, y) {return x+y}
A couple of weeks ago I found an interesting use of this syntax. Missing Ruby’s wonderful each function, I decided to implement something similar in JS, and, after some experimentation, ended up with this:
function each(a, f) { for(var i=0, l=a.length; i<l; i++) f(a[i]) };
The function syntax comes in handy when you use this each:
each([1, 2, 3, 4, 5], function(e) { alert(e) });
It may not be as satisfying as Ruby’s each, but it’s quite useful.
|