3 ms·
> Go should generally be a bit faster or equal speed to Java and should use a fraction of the memory. Eh. Go certainly starts out faster and is faster in some
by pron 9y ago
> Go should generally be a bit faster or equal speed to Java and should use a fraction of the memory.
Eh. Go certainly starts out faster and is faster in some benchmarks, but in most workloads Java is faster.
> but even Java 8 doesn't have the ability to set a variable equal to a function definition
Function<Integer, Integer> f = x -> x + 1;
> which I don't think any JVM language has.
Java (and so all JVM languages) has had Unicode support since at least 1997.
> The standard library feels really good to use compared to C++ and Java for me
I think you haven't seen Java's standard library recently.
> The tool chain.
This is one area where Java is ahead by a large margin in almost every single component you list.
For me, Go shines for small applications, and especially small command-line tools, for which the JVM is not a great fit. It's easy to learn and get started with, and the deployment is convenient. But for anything big, Java wins hands down, in robustness, ecosystem, debuggability and serviceability.
- Olreich 9y ago> but in most workloads Java is faster. I can't find any data to back that up, can you point me at some? > Function<Integer, Integer> f = x -> x + 1; Fair point, didn't know about Function > I think you haven't seen Java's standard library recently. I dislike the standard library. It feels kludgy, as if things were added haphazardly for the last 20 years. It's still missing valuable things that have been around and proven to be very common and desired, like format reading/writing (CSV and JSON come to mind). The HTTPServer implementation is even in com.sun.* and isn't part of the official standard library. Oracle even has a page telling you not to use it: http://www.oracle.com/technetwork/java/faq-sun-packages-142232.html http://www.oracle.com/technetwork/java/faq-sun-packages-1422... > This is one area where Java is ahead by a large margin in almost every single component you list. Java as an ecosystem, they may be ahead in some ways (IDE + Gradle). But Java is not, they are missing most of the components I listed. You have to use an IDE and Gradle/Maven to come close to the out-of-the-box experience with Go. And I did note that IDE support is one of the negatives.
- pron 9y ago> I can't find any data to back that up, can you point me at some? These[1] are some recent results of the computer language benchmark game, where Java beats Go overall even though startup time is measured (similar results here[2]). How much faith you'd want to place in these benchmarks is questionable. As to real workloads, that's what people I know at Google tell me. > It's still missing valuable things that have been around and proven to be very common and desired, like format reading/writing... I don't think any of it should be part of the standard library. In fact, one of the best things happening with Java now is that the standard library is being broken apart, and things like XML, cryptography and JDBC are taken out of the "base" module. OTOH, a standard library should provide truly foundational stuff, like good data structures, deep monitoring infrastructure, things that Go seriously lacks. > You have to use an IDE and Gradle/Maven to come close to the out-of-the-box experience with Go. But that's because the Go ecosystem is poor in comparison. The Java ecosystem is so strong and well established that the "out of the box" package simply can't compete with it (and when it tries -- as with the logging API -- it loses). Go had to provide this stuff out of the box because there was no ecosystem. True, this makes Go much easier and more pleasant to get started with for beginners, but you can't compare something that's built around an ecosystem, and something built to be self contained. [1]: https://sites.google.com/view/energy-efficiency-languages/results?authuser=0 https://sites.google.com/view/energy-efficiency-languages/re... [2]: https://benchmarksgame.alioth.debian.org/u64q/compare.php?lang=java&lang2=go https://benchmarksgame.alioth.debian.org/u64q/compare.php?la...