Why Ruby?

Nick Sabalausky a at a.a
Sun Dec 12 10:34:10 PST 2010


"Simen kjaeraas" <simen.kjaras at gmail.com> wrote in message 
news:op.vnl1katxvxi10f at biotronic-pc.lan...
> so <so at so.do> wrote:
>
>>> If we take a look at the very first code example from the talk it looks 
>>> like this:
>>>
>>> account.people.each do |person|
>>>      puts person.name
>>> end
>>>
>>> You could translate this in two ways when translating into D.
>>> First way:
>>>
>>> foreach (person ; account.people)
>>>      writeln(person.name);
>>
>> Am i alone thinking D one better here?
>
> Absolutely not. Ruby reads like Yoda-speak, while D is almost plain
> English. Had foreach used 'in' instead of the semicolon, only
> punctuation and 'ln' would be off.
>

Unless I'm mistaken, I think I heard somewhere that the original creator of 
Ruby is Japanese. Japanese grammar puts prepositions at the end of 
prepositional phrases and verbs at the end of predicates, so I'm guessing 
that's why Ruby ended up that way. Although Ruby's function calls are still 
"function/verb first, then params/nouns", so I dunno.




More information about the Digitalmars-d mailing list