Readable Java 1.5
Subject:   interesting, but...
Date:   2003-09-25 05:36:07
From:   anonymous2
I agree that there are readability problems, but:
- I don't agree with the "eachof" keyword: why not use the "in" keyword ? It is exactly what the ":" means !
- the angle brackets syntax for generics is clear enough for both C++ and Java (former C++ ?) programmers :)
- question: do we really need the variance stuff ? Does the average programmer need to have a ph.d to understand theory about Java language ? Where is going simplicity, the greatest among Java features ?

by Dimitri De Franciscis

Full Threads Newest First

Showing messages 1 through 4 of 4.

  • interesting, but...
    2003-09-25 11:44:47  sjungels [View]

    I wanted "in" also. The reason I didn't argue for it is that it's already used by Java compiler writers would have to do backflips to distinguish between an "in" keyword and "in" the member variable. So "in" is out, unfortunately.
    • interesting, but...
      2003-09-29 15:26:12  anonymous2 [View]

      I tend to think that clearer syntax is much more important than the difficulty of writing the compiler. After all, many more people write Java code than write Java compilers. Is this one of the major reasons Sun did not want to use the "in" keyword?

      Of course, I am not planning on ever writing a Java 1.5 compiler.

      Thanks for the article, I really enjoyed it.
      • interesting, but...
        2003-12-20 06:54:24  anonymous2 [View]

        Java's keywords are reserved -- you can't
        use any of the keywords as variables or
        method names. Making an exception for "in"
        isn't just a matter of making it "difficult"
        to write the compiler, it's a radical change
        in the language structure that would require
        the lexer to be context-sensitive. Sun would
        (justifiably) never ever make such a change, so
        it's pointless to debate the value of an "in" keyword.

        Someone suggested "from". "of" is another
        possibility. But it's not like Sun didn't
        consider these -- they almost certainly did,
        and rejected them because there may be programs
        that use them as variable names. Thus, they
        chose the ":" syntax, and it's very unlikely
        that they're about to change their minds.
    • interesting, but...
      2003-10-16 15:18:11  anonymous2 [View]

      maybe a 'from' ?
      Object o from collection