Why Ruby?

Andrei Alexandrescu SeeWebsiteForEmail at erdani.org
Mon Dec 13 09:49:49 PST 2010


On 12/13/10 11:39 AM, Nick Sabalausky wrote:
> "Stephan Soller"<stephan.soller at helionweb.de>  wrote in message
> news:ie4srq$138c$1 at digitalmars.com...
>> On 12.12.2010 18:01, Simen kjaeraas wrote:
>>>
>>> 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.
>>>
>>
>> Unfortunately I have to disagree here. If you have well written Ruby code
>> (like Ruby on Rails usually provides) it can usually be read like plain
>> English. That's the reason why I dropped writing documentation comments
>> for Ruby code: it's just redundant.
>>
>
> This common Ruby idiom is totally Yoda-speak to me:
>
>      doSomething unless condition?
>
> The order-of-execution is completely backwards. Plus the "unless" instead of
> "if" makes my mind pause to process an "inverted-context" because *now*
> seeing a "blah" really means "not", and a "!blah" no longer means "not".

Perl has had a long time to experiment with this, and at least some of 
its dominant coding standards unrecommend use of trailing conditions.

Andrei


More information about the Digitalmars-d mailing list