markspace wrote :
Wojtek wrote:
both ftp methods return void. I would think that the compiler would
be smart enough to realize that nothing CAN be returned.
Jeff Higgins wrote:
Does it sound childish to ask why?
The way the OP puts it, yes, it comes across as a bit childish. The OP
didn't ask "why," he asked for "thoughts." My thought is "read the JLS."
Hmm, I wasn't questioning the compiler as I would hope it follows the
JLS.
Yes, I have a C background, and I have used this expression many times,
and indeed I have nested it several layers deep, since it made most
sense (to me) to do so.
I realize *you* asked why, but in the vein of the OP's premise, I feel "read
the spec" is a valid answer. "Why" requires reading someone's mind, and time
travel. Since those are obviously impossible, the result borders on
trolling.
So questioning a design decision and trying to understand its rational[e]
is trolling? Really?
I'd guess that the original intent and the current thinking is that Java
should be "easy to read" and that shortening branch flow to a single
character pushes somebody's Perl buttons, but that's a total guess.
There are many ways and many people who try to write code which is easy
to read. Anyone can write obfuscated code, but seasoned coders tend to
try to simplify where possible, not use clever tricks, at least IMHO.
What about this:
(some large expression || some other large expression )
? {
Statement;
Statement;
Statement;
} : {
Statement;
Statement;
Statement;
}
Interesting. I had not followed the idea that far. Though in common use
it really just replaces a succinct if/else construct.
'if' is two keys plus 'then' is four for six keys. '?' is two keys.
'else' is four keys, ':' is two.
Advantage: '?:' ten to four.
adding four keys. Now the advantage is ten to eight.
And '?:' loses its place as an operator.
minor for such a fundamental shift.