Women in Technology

Hear us Roar



Article:
  Readable Java 1.5
Subject:   I like this
Date:   2003-09-25 11:34:38
From:   sjungels
Response to: I like this

I think you understood my point very well. Part of the reason I was motivated to write this in the first place is that I think one of the most important things a language designer owes his users, is continuity. A ":" that means foreach is probably all right for Perl programmers. Likewise, angle bracket generics are going to please C++ programmers. But neither one strikes me as consistent with "the Java way," which is more verbose and clear, and which I really like.
Main Topics Oldest First

Showing messages 1 through 2 of 2.

  • I like this
    2003-10-01 07:39:38  anonymous2 [View]

    Using a ':' in the 'foreach' construct seems to me to be in line with the for(;;) syntax, a terse syntax the meaning of which is arguably also not immediately apparent.

    Also, the characterisation of 'the java way' as more verbose and clear is fair enough, but this characteristic is quite unevenly applied - cf 'for (;;)'. In particular, there's no real increase in verbosity over C++, when it comes to control flow type of code (that I can think of).

    So, there's clearly a precedent for terse initially confusing syntax in Java.
    for (T t : coll) is going to be a commonly used construct, so the terseness is ultimately a benefit - I would argue in readability as well as writeability.
    Conceptually, it's certainly easier to get one's head around than for(init;test;uh...thingy)

    In the end, IMO, your proposals dont really offer anything over and above the 1.5 syntax. But the article was interesting and thought provoking.
  • I like this
    2003-09-26 08:12:11  anonymous2 [View]

    As a java programmer who never learned C++ I get really tired of hearing how Java is like (or should be like ) c++ with its syntax. One of the things that I really like about Java is that its syntax is usually clearer than syntax in other languages. The colon is a bad idea. It looks like a java operator but represents a keyword. Very confusing. The colon would fit very well in PERL but this ain't PERL. I like PERL as well but some of the most cryptic code I've ever had to deal with was written in PERL.
    As for things like variance, I think it's a mistake to put this into the core language. I've never had a need for it.