Win a copy of Svelte and Sapper in Action this week in the JavaScript forum!

Mike Simmons

Rancher
+ Follow
since Mar 05, 2008
Cows and Likes
Cows
Total received
40
In last 30 days
1
Total given
1
Likes
Total received
563
Received in last 30 days
21
Total given
84
Given in last 30 days
12
Forums and Threads
Scavenger Hunt
expand Rancher Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Mike Simmons

Thanks.  Can you say more about that?  Is that because IE just isn't so important anymore?  Or because we rely on other libraries or tools to compensate?  How does that work?  Thanks...
And if we give IE the finger, we have the lovely

27 chars, 14 + 13
Well on the JavaScript side, I can get 39, Cay's root method declaration of 14 chars plus 25 characters of implementation:

Rob Spoor wrote:

Mike Simmons wrote:But I don't see a new certification coming out of this release.


I know that's probably meant as a joke, but Oracle will never do any certification for non-LTS versions like this one.


Correct on both counts.
1 week ago

Cay Horstmann wrote:
In Java, you need 44 characters just for



Then you can complete the function with another 27 characters. (At least that's the shortest that I can come up with.)



Well, I would increase your original 44 chars by one, 45, and then I can complete it successfully with only 22 more characters.  But I think we're talking about the same thing, essentially.  And your version has the more correct return type.
Ah, interesting.  Thanks!
Java 15 Release notes.

Not much to excite... text blocks... hidden classes... CharSequence.isEmpty(), more efficient TreeMap methods... Well, I like the text blocks.  But I don't see a new certification coming out of this release.
1 week ago
I suspect this was an intentional change from C rules, where they were deliberately disallowing something that seemed unnecessary or confusing.  Like when they required the condition in an if statement to be boolean, preventing many of the errors when we mixed up = with == in C.  I very much doubt they would have changed this behavior in Java after public release... Sun just didn't do that sort of thing.  
1 week ago
Tim -

(written before seeing Frank's last post above)

If you try compiling with javac from the command line, I think you'll find this is not an Eclipse issue, but a Java rule.  As far as I know it's always been this way... though from my side, I guess I never explicitly tried to test it either.  But Frank already showed and explained the section of the JLS that prevents it... I can't find an online JLS older than 3rd edition (Java SE 6), but it was there back then as well:

15.14.2 Postfix Increment Operator ++

PostIncrementExpression:
       PostfixExpression ++

A postfix expression followed by a ++ operator is a postfix increment expression. The result of the postfix expression must be a variable of a type that is convertible (ยง5.1.8) to a numeric type, or a compile-time error occurs. The type of the postfix increment expression is the type of the variable. The result of the postfix increment expression is not a variable, but a value.


(emphasis added)

This is the same rule that bars stacking infix notation in the current JLS, that Frank originally asked (and answered) about.
1 week ago
Campbell: well, you can get it to compile if you also assign it to something, e.g.

It doesn't work as a standalone expression.  More to the point, it does not in any way represent "the ability to stack prefix and postfix" - that statement was simply wrong.  Frank correctly addressed what Tim was actually talking about.
1 week ago
Frank- no, sorry, I was joking.  The idea of "plain English in the JLS" sounds like a logical impossibility. Or at least, an improbability. . You were clear; nothing to apologize for.
1 week ago
Well, I for one am curious to see what your intended solution was then.