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:50:38
From:   ikayak
Response to: Not maintainable or english

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.


Main Topics Oldest First

Showing messages 1 through 3 of 3.

  • A question
    2005-10-29 08:52:49  ttfkam [Reply | View]

    What is the equivalent of the following?

    for (i=0; i<100; i+=4) {}

    Not attacking; I'm honestly curious.
  • Not maintainable or english
    2005-10-23 20:20:32  jimothy [Reply | View]

    I'll agree with the others on the parallel assignments; this introduces a lot of confusion that could be eliminated with just an extra line of code.

    The loop (10.times), however, I think is rather intuitive. I'll also note, that while you're quick to jump to its defense, nobody has complained about this loop syntax as far as I can tell. It's those darn parallel assignments that are catching flack.
  • Not maintainable or english
    2005-10-21 09:11:50  greg_barton [Reply | View]

    To your example, how about: use the red and yellow bowls for ketchup and mustard.

    In English, strictly speaking, this is ambiguous. Can I use a yellow bowl for ketchup? Maybe. If you say, "You didn't understand..." I just come back with, "Well, you said I could use red and yellow bowls for both ketchup and mustard." You say, "I didn't mean BOTH!" And I say, "Well, why did't you say so?"

    Anyway, I don't see the appeal for making a programming language more like English. English must be one of the least precise languages on the planet. That's great for rhetoric, poetry, and prose, but not for programming. I see nothing wrong with using a few more lines to get your point across as precisely as possible.