Article:
  Readable Java 1.5
Subject:   I like this
Date:   2003-09-24 16:39:46
From:   revdiablo
I agree with your basic premise that the newly proposed changes to Java are not desireable. I think the addition of new and alien (from a Java point of view) syntax is not the best option. I think your proposed alternatives are definitely nicer and fit better with the language. In short, I completely agree! :)


I might note that my true love is Perl, with Java coming in a close second. Interestingly, Perl tends to adopt the idea that new syntax, if used appropriately, is fine -- leading to what some people consider the Line Noise Syndrome. This makes sense in Perl contexts, but in Java it just doesn't seem to work. Java is an altogether different beast; adding syntax in Perl may make sense, but instead adding new keywords in Java is probably the best option.

Full Threads Newest First

Showing messages 1 through 5 of 5.

  • I like this
    2003-09-25 11:34:38  sjungels [View]

    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.
    • 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.
      • I like this
        2003-10-01 03:13:06  anonymous2 [View]

        >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.

        Your comment suggests you probably dont know what variance is, so why hold & express a negative opinion of it?

        Since variance is a feature that works with generic types, which arent in java yet (except GJ etc), is unlikely you would have "had a need for it", is it?
        • I like this
          2003-10-23 15:21:45  anonymous2 [View]

          You're right. I should have left the comment on variance out.
    • 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.