Why Ruby?

Simen kjaeraas simen.kjaras at gmail.com
Sun Dec 12 09:01:12 PST 2010


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.

-- 
Simen


More information about the Digitalmars-d mailing list