136 points · by based2 · 8y ago · 130 comments
The reason the community is struggling with Java 8 to Java 9 is that 9 broke a TON of stuff. It's not backwards compatible at all. Basically every non-trivial app broke. The breakages are mostly in things that were technically never guaranteed, even trivial things like the version number went from "1.8" to "9" which makes sense but broke loads of programs that tried to parse the version.
But some of it is also just bad processes and habits in the community. Some of the programs that broke due to the version number change from 8 to 9 broke again from 9 to 10 just months later because they had enums that listed every possible version.... their codebase literally encoded the assumption that new major java releases hardly ever happened!
I heard one good approach is to start testing newer releases in your CI systems as soon as possible but wait for the next LTS ever few years to migrate production.
Apache Groovy hasn't even updated its syntax to support Java 8 lambdas. It's coming in Groovy 3, apparently.
http://www.theregister.co.uk/2016/12/16/oracle_targets_java_...
Please someone correct my perception here, but it looks the the goal of the rapid release cadence is now to get more enterprise support contracts: if you want to stay on LTS, you have to pay.
In the end the thousands of businesses an thousands of open-source projects that use Java will continue to use Java. Others will invest in the FUD around Java and Oracle. Life will go on. It'll be interesting to see who comes out on top.
http://www.oracle.com/technetwork/java/eol-135779.html
Aren't we talking about the company that wants to copyright api no matter what effect his has on the rest of the industry.
The same oracle that buys and kills interesting project making the world a less interesting place.
The people that are suing google for violations that the original owners of the IP tacitly allowed.
You are awful quick to call criticism of oracle FUD and delusion. Are you sure you don't work there?
That would have made a lot of people happy.
Anything that stops businesses asking me to target Java 1.4 on abandoned Red-Hat 5 servers is good on my book.
Among the reasons Python devs cited were that it was hard to get printed correctly in books, and hard for users to write in general, depending on keyboard layout.
Hint: Let programming languages use characters 1) in the ASCII character set and 2) not diacritical marks, and you'll be fine... It's honestly not rocket science. I think it's a programming language designer's responsibility to just know these things in 2018.
In the competing .NET Framework, @ is used for raw string literals, as in @"raw string". The diacritical marks ~ and ^ do occur there for bitwise logical operations and ~ in declarations of destructors but I don't think this is optimal. I never really understood why they inherited C++'s destructor syntax to have a semi-obnoxious special symbol just for this particular one case that is used at most once per entire class definition, that is shared with bitwise complement (???), no less... Is it so bad with keywords? Or why not just use "!" as in "not". It would at least make more sense.
String s = <<<TEXT
<html>
<body>
contents
</body>
</html>
TEXTIf it keeps going in its new direction, soon they'll just be able to name it javascript. :)
Learning from other peoples' code is not generally considered harmful.
I think the issue he was speaking to was that if many of the new features require doing things in a new way then it really is something new. But your point is well taken as well. C++ is still C++ whether you use standard templates or not.
The GCC C++ parser is over a megabyte of ASCII text. Think about it: it takes over a million characters to figure out how to parse C++ code. This complexity is partially because there are so many ways to do the same thing.
All auto parameters, or make it a template? `if constexpr` or `std::enable_if_t`? Macros for generic programming or variadic variadic template templates? Overloading or specialization?
I love C++, and backwards compatibility is something that's been valuable for it, but it certainly comes with its challenges.
Firstly, nothing requires you to do things in a new way.
Secondly, if “you could already do that” implies “not really something new” for a programming language, updates to the syntax of programming languages can never count as “really something new”.
int val = switch (str) {
case "foo" -> 1;
case "bar" -> 2;
case "baz" -> 3;
default -> -1;
}
Looks a lot like Scala: val foo = match (str) {
case "foo" => 1
case "bar" => 2
case "baz" => 3
case _ => -1
}
Interestingly the underscore character is now reserved in Java, wonder what use case(s) they have in mind there?> We are "reclaiming" the syntactic real estate of "_" from the space of identifiers for use in future language features. However, because there are existing programs that might use it, it is a warning for identifiers that occur in existing syntactic positions for 8, and an error for lambda formals (since there is no existing code with lambdas.)
Example:
BiFunction<Integer, String, String> biss = (i, _) -> String.valueOf(i);
It basically means that one of the lambda parameters is unused.And citing this JEP 302:
We are now free to complete the planned rehabilitation of underscore
to indicate an unused lambda, method, or catch formal parameter. val emails = users.map(_.email)
Unlikely that will make its way into Java anytime soon, if ever, but it would be a nice enhancement -- being forced to pepper your code with lambda expressions a la `x => x.foo` is annoying when the alternative `_.foo` conveys the same meaning.It has great library ecosystem, concurrent data structures, sane enough memory models.
There is great new cutting edge work going on on the JVM: G1GC, grasp/truffle, etc. There are great distributed systems/platforms like gRPC, zookeeper, cassandra, kafka, and hadoop.
The IDEs are great. Debuggers are fantastic. Hot patching live code could be better but it's not hard if you plan for it.
As for the Java language itself: sure it can be a bit cumbersome and verbose from time to time. But reading even the trickiest code is usually pretty explicit and decipherable. Not being the most "featureful" language plays to it's strengths. I find myself missing Java when in python or go as much as the reverse. It's part of the reason why Kotlin seems to be taking back some Scala fans. Kotlin is more Javay.
As much hate as it gets its a surprise to hear that people think it's confined to legacy work. From where I'm sitting I'm pretty optimistic about its future.
The JVM is a different beast than the one you knew 15 years ago. GC is not a problem (usually) anymore. Change of hardware? Change of OS? Want to develop on something else? No big deal, it's all on the JVM. And it's a pretty damn fast JVM.
It's got an extensive library ecosystem that isn't going anywhere. Because enterprise uses it so extensively, there's lots of support for it, lots of demand for it. Amazon is big on Java- heck they hired Gosling last year.
Java is stable, not going anywhere, and an easy choice to make. So yes, people are happy that it's getting better linguistically. Stop being a language snob.
And with the introduction of Graal and Truffle I'd say Java is one of the more interesting languages to follow nowadays.
In principle - it's just convenient in many ways.
If you take people who instead learned Python as their first language, and put them through all the ceremony that is getting "hello world" to work in Java, you're going to get a very different reaction. A lot of this is very dependent on perspective.
It's one line with the official java REPL jshell. Two lines, if you want a GUI (Swing).
The only reason Java still exists is because it created a generation of professionals who only know Java, only do Java, and won't learn anything else. That group is still large enough to maintain critical mass and create new greenfield Java projects despite the fact that Java is a shit-poor choice of language for those projects today.
Language-wise C# overtook Java quickly, but SUN was all about openness and about not being big bad Microsoft, and that resonated with the majority of idealistic developers.
Also that whole "Android" thing happened.
Java should have focused on being a better "business" language. Type inference, string intrinsics, built-in regex, intrinsic arrays and maps, lightweight objects.
I love functional programming. For my own projects. When I want to get my lambda on, I'll use Clojure. No way I want to wade into someone else's extravagantly tortured dynamically typed, meta tagged, lambda spaghetti code.
Annotations, optionals, generics, lambdas, and other cargo cult inspired additions have reduced Java's core value proposition.
Fortunately the tooling and JVM are awesome sauce.
I think the biggest problem is that it is in the nature of most developers to want to live on the bleeding edge. We want to have these new shiny purple things. And it just hurts us deep down inside to go with the safe and mature option.
Again, nobody is forcing you to adapt a new version as soon as it comes out.
And also, the cadence means that java changes will be much smaller, so no more big bang like Java 9.
The only real problem might be the bytecode releated libraries like ASM/bytebuddy, those need to move faster then previously (and they are, e.g. butebuddy already supports java 11 bytecode version).
However they adopted the versioning scheme from Ubuntu and I honestly think it is confusing.
What really is going on is this:
1 Major version 1
2 Major version 1 + latest and greatest features pack 1
3 Major version 1 + latest and greatest features pack 2
4 Major version 2
5 Major version 2 + latest and greatest features pack 1
6 Major version 2 + latest and greatest features pack 2
7 Major version 3
8 Major version 3 + latest and greatest features pack 1
9 Major version 3 + latest and greatest features pack 2
...
Picking a version scheme that made that obvious would have been helpful.With an increment in the major version number indicating that a release contains significant new features and/or old features being removed.
The scheme you propose would imply that it is only LTS releases that get significant new functionality.
And as far as the LTS version of Java, 3 years seems a little long to wait for any updates but 6 months seems short to to drop support.
If I ever get back into Java, it will be solely for Android development. Does any of this affect Android development?
I haven't used Java in years, is the Java ecosystem under Oracle as bad as it appears from the outside?
Then we will see where Kotlin lands, specially since Fuchsia uses Dart.
We're also unlikely to benefit since vendor software can't upgrade (or won't certify new versions) and the mannequin developers consultancies place offshore can barely work with Java 1.4 concepts. Best I can hope for is improvements in GC and better defaults.
The quicker pace with smaller changes will hopefully help with this friction.
At first I read it like: "Man at this point there is 0 reason to use kotlin".
But come to think about it, it makes just as much sense.
Perhaps you can explain why you think there is 0 reason not to use Kotlin now?
Can’t wait what next 10 will bring - native json and html/jsx/xml perhaps?