Java 8 vs. Java 9
romexsoft.com
romexsoft.com
That being said, I just can't get excited about new language features now that I have discovered Kotlin. It is essentially Java but with a much smarter compiler and a more modern and sane syntax.
The designers basically removed everything that made Scala slow to process and hard to optimize. As a side-effect, Kotlin is much easier to read and understand than Scala.
(E.g. as applications get larger you tend to need to understand the reasons for why something didn't happen, so you move from Option on to using an Either-style type that carries some information in the failure case. But Kotlin is hardcoded around using null to express absence and it's impossible to migrate from that to something that includes a reason).
No. It's not.
Also, I notice that, as I write type-safe code, I don't usually compile that often and, when it compiles, it is likely correct.
The incremental compilation is pretty good.
They should have stuck to their original mission of reducing programming mistakes and boosting productivity.
String processing, a la perl, Python, is something every single developer does every day. We need multilines, intrinsics, first class regexes, etc. every day.
They should have made 'utf8', 'utf16', etc first class scalars, reducing the memory footprint of java.lang.String, and everything reliant on String, ages ago.
They should have increased conciseness, a la Kotlin, Ceylon, Nice, Boo (minus the duck typing), ages ago.
I'm also eager for lightweight objects (value types?), a la Kava, which I think has been pushed back to JDK 10.
I usually use groovy for my fun/toy projects but at my day job writing enterprise code the tests have huge JSON building blocks before the actual assertion happens.
If I'm trying to test how my system will parse a specific JSON case into a domain object, isn't it easier to read if my test case is completely expressed on the screen?
Even when I develop in Python with multiline strings I use fixture files to better organise my code.
Edit: removed an "even" before maintainability that was part of a first draft.
None of the new features has anything to do with dynamic languages[0]. Streams and lambdas are still statically typed.
[0] Well, there is DynamicInvoke, but this is not a Java feature, but a JVM feature.
* The API and implementation will not be part of Java SE.
* The API will live under the jdk.incubtor namespace.
* The module will not resolve by default at compile or run time.
Modular source code is internal reorganization of JDK. Hopefully it will not affect Java developers negatively.
Process API: It can provide PIDs finally. Seems like big feature for Java 9.
JShell: May find some use. Not sure how many Java developer care about it.
#!/usr/bin/env java
For my own projects, I foresee replacing all those goofy build tools with straight Java. Less impedance mismatch.I thought Jigsaw was rejected.
I'm not entirely sure what that actually buys, when classes are loaded only on demand anyway...
However they have been talking how to solve this and the new release is planned for end September.
It's 2017, where are the REPLs for Go and Rust?
I know Java since the early releases and the only thing that comes to mind is Beanshell, which was around that time.
Nobody's gonna make a REPL for languages nobody uses :^)
/s
Also, are you familiar with Groovy and Scala and their intended uses?
Like, all the time?
REPL becomes an integral part of the programming process if your language has one.
Could you give me an actual example on how you use REPL during development?
Simply being able to repeatedly invoke functions from the REPL without breaking your flow changes the way you program. It's a completely different experience from the usual edit->compile->run cycle, and even from the TDD edit->run tests cycle.
Also, if the language didn't just bolt a REPL on top of itself because it's fashionable, but actually was designed as an interactive programming medium, you'll have powerful introspection and runtime code modification possibilities that together speed up the debugging process. (Experienced readers will know which language families I have in mind here - the ones which surprisingly weren't even mentioned in JEP222 which this article links to).
But not Java, which is statically typed and an IDE that takes care of most of the stuff you mentioned.
edit: java also has hot swapping of running code.
(Conversely, a language with a decent support for interactivity enables IDE developers to provide tools further enhancing interactive programming.)
I've programmed in numerous languages that offer a REPL. I've never found them useful.
I'm sure you'll now tell me I was using the wrong languages, or just needed to do it differently and by God I'd see the light!
I would suggest that instead you accept that not everyone is like you. Everyone's creative process is different. A REPL has never fit into mine.
You think I haven't experimented with REPLs from time to time? :)
https://docs.microsoft.com/en-us/dotnet/framework/app-domain...
(Yes, I hate half-assed design.)
"We are using cookies to improve your experience of our site. By clicking ‘Agree’ or ignoring the banner, you are assenting to our use of cookies."
I don't really care, but is this strictly speaking legal? "If you don't read this, you agree to it"? If I read it, am I "ignoring the banner"? Usually if you don't agree, they are supposed to not store cookies and ask every time, which is something I'm actually OK with.
I'll tell you a little secret, Java is the number one programming language in the world just because it is used by millions of programmers for Android apps and a few enslaved programmers in corporate gulags. Once Kotlin takes the Android world by storm Java will sit next to Cobol in the history books of technology.
Your secret does seem like secret to lot of people. In my knowledge Java is big because lots and lots of companies use Java stack for boring enterprise applications. And in those places people could care less about cool stuff and work on things that pays.
Cobol is still used in very critical software at big Banks. Java along with it quite respectful place. Whereas Kotlin is a little bit of lot of things. Runs of JS/JVM/Native but none of them a unique strength for Kotlin. So it will be very difficult to compete with languages which committed to single platform and have serious business use cases.
Whenever I work on a java-codebase and see a class that could be expressed much simpler in Kotlin I press "Cmd+Option+Shift+K".
Intellij IDEA automatically converts this file to Kotlin. The codebase continues to work without issues and I can proceed extending this part in Kotlin.
This is an incorrect and terribly biased opinion. I have been working primarily in Java for over five years and neither of those applies to me. Java has been a core language in ML and NLP for at least a decade.
That means you have all the libraries, performance and profiling tools that java has.
Please read the OP before commenting.
But Android tooling is heavy dependent on Java and Google even had to drop their Jack/Jill compiler replacement, because they weren't able to make it work properly with all the tooling that targets the JVM.
So they pivoted to translating JVM bytecodes into ART ones (originally Dalvik ones, DEX) again.
However even with the way Google has handled the Java story, the whole Android eco-system is heavyly dependent on it.
They also pivoted the Brillo project with the promise of a set of C++ userspace frameworks, into Android Things using Java instead, including the ability to write device drivers in Java.
Hence why thinking that Kotlin can manage without Java and its eco-system is kind of strange, even on Android.
EDIT: Of course it runs on Dalvik as well when targeting pre-Lolipop devices.