advertisement

Article:
  Technologies to Watch: A Look at Four That May Challenge Java’s Development Dominance
Subject:   Not maintainable or english
Date:   2005-10-20 16:40:58
From:   kgelner
Response to: Seaside link

I didn't much care for the parallel assignement either, all fun and games until you accidentially delete something from one side and then have to remember the order they were in (or worse yet accidentally put it back wrong).


Also, how can you claim that line is english? People do not talk like:


I'll put the ketchup, car keys in the fridge, drawer.


Although really in Ruby would it not be more like:


In the fridge, drawer I'll put the ketchup, car keys.


It is consise, but claiming it reads like english is a stretch.


It's not having Java on the brain to dislike a feature like this, it can also be from seeing years of the kinds of mistakes that syntactic shortcuts can cause. I like some of them but they have to be used with care.

Main Topics Oldest First

Showing messages 1 through 1 of 1.

  • Not maintainable or english
    2005-10-20 16:50:38  Bruce A. Tate | O'Reilly Author [Reply | View]

    10.times reads very much like English. As does print hello if not i == 10. As does has_many :cars. Ruby lets me introduce verbs.

    To your example, how about: use the red and yellow bowls for ketchup and mustard. The intent is very clear, without the need for temporary variables.

    If the assignments are not related, don't use them together. It's a very useful high level abstraction. And yes, it's one that we use in English. I can't believe you're actually arguing for

    for (i=0, i<10, i++).

    The only reason that makes any sense at all is that you've done it for 30 years in C, C++ and now Java. In Ruby,

    for i in 1..10

    1..10 is a first class range.

    Ruby may not be to your liking, but it's a pretty clean language, and it's much closer to English than Java.