| 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. | ||
Showing messages 1 through 4 of 4.
-
I like this
2003-09-26 08:12:11 anonymous2 [Reply | View]
-
I like this
2003-10-01 03:13:06 anonymous2 [Reply | 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-01 07:39:38 anonymous2 [Reply | 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.




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.