Underscore is a keyword in Java 9, use this script to check your code (2015)
blogs.oracle.com
blogs.oracle.com
At last year's JLS the keynote mentioned that reserving underscore did not mean that Java is becoming Scala. And yet, what else are they going to with it other than to slowly integrate Scala idioms into the language?
If alternative JVM languages gain enough traction perhaps archaic boilerplate like having to define Java getters/setters, equals, hashCode and toString on data classes will replaced sooner than later with terse "modern" equivalents found in C#, Scala, etc.
http://git.net/ml/lambda-development-java/2013-07/msg00350.h...
/sees the horror on the faces of all the lodash users/
Ok that was not a good idea
teo ~ node -v
v7.3.0
teo ~ node
> _ = "hi"
Expression assignment to _ now disabled.
'hi'
> _
'hi' $ node
> _ = "hi"
'hi'
> _
'hi'
> foo = "bar"
'bar'
> _
'bar'
(See mattnewton's reply for explanation.) > _ = "hi"
Expression assignment to _ now disabled.
'hi'
> "bar"
'bar'
> _
'hi'
> foo = "bar"
'bar'
> _
'hi'I can't speak to the pros and cons of ℵ-vs-א, but in other geographies I have found mixing RTL and LTR to be a real PITA. Especially if one is touch-typing and not eyeballing the screen from time-to-time. Of course, before Unicode, we got to tell developers: "Just use ASCII for variable names. That's why God gave us 127 keys."
[0] Some call him arrogant. Others say that I intentionally truncated the quote for my own evil purposes. Who is to judge?
Add a new key"word", don't deprecate a whole fucking character in a language that's been around for twenty years.
It pains me to consider the horrific amount of code this will break. The lifetimes of hours spent deleting _ that would have been writing whimsical poetry in a moonlit garden or curing cancer.
I'm not surprised I guess given that Java is "owned" by Oracle now. Hopefully they kill it off quickly so we can get the migrations to openjdk overwith.
that's... quite a lot of _
Here is something I made to lighten the mood: https://i.imgur.com/qzOPn85.png
.. or maybe this is even scarier. I'm not sure.
edit: downvotes from java devs incoming :D
Edit: I'm a Java guy too, don't get why some people get so butthurt over things :)
At least it's not JavaScript with infinity,null,undefined, and NaN. Oh and null!=null which is hilarious
I more of a C++ guy, but I like Java very much and have used it extensively in the past. I personally like a good C/C++ joke and can't understand why the Java devs are so serious. Apparently nobody is allowed to joke about Java, it's serious business :D
NaN != NaN is surprising, but is not unique to JavaScript. As far as I know, this is the case in every language, and is mandated by the IEEE 754 specification.
However, it does come up in JavaScript more often than other places, since NaN is really easy to get (+{} => NaN, 1 - '' => NaN, etc, etc).
someObject.doSomething(_ -> isDerp());
That's exactly what they're doing. And exactly why many languages are hesitant to add new keywords ever, since you could be using anything as a variable name. (Hence the practice of reserved words which might become keywords in the future.)
> I'm not surprised I guess given that Java is "owned" by Oracle now. Hopefully they kill it off quickly so we can get the migrations to openjdk overwith.
What makes you think that OpenJDK isn't owned by Oracle, or that OpenJDK won't add the _ keyword, given that it's part of the Java 9 spec?
Almost none.
_ was never encouraged, promoted, it wouldn't really fit with any sort of Java coding practice at all.
So I don't think it will be a huge issue.
This is Java, starting tomorrow it's a keyword because why not, but let's keep in type erasure or the software on our Java Ring (TM) breaks.