Hacker News new | past | comments | ask | show | jobs | submit login

So why did we need go when Java already existed?



Try writing e.g. a TLS proxy in Java and then in Go, and get back to us.

For byte arrays, sockets, encodings, cryptography, etc. the stdlib in unparalleled.


Not arguing that Go is a great fit to these niches, but imo java has a really great standard library, including these areas.


I don't know, why did we need Java when CL/Smalltalk/etc. already existed?


Because Java has become an unpleasant to code in. Do you really think what you like is what everyone else likes?


While I agree with sibling poster that modern java is nothing like the old times, are we seriously comparing it to Go with manual error handling and the like?


If you are still coding in Java 5 then yes it is unpleasant. I have seen a lot of java 5 like code in Java 8 environments and hence the unpleasantness. However, even though I am still upskilling myself to use Java 11 and later, I am finding that my Java code is less verbose and more efficient.


I sorely miss some kind of functional streams api in Go when switching between Go and Java. for-loops make the equivalent code absolutely awe full, plus it’s not automatically parallelizable by replacing .stream() with .parallelStream(). IIRC, some Go luminary decided map, apply filter etc. we’re no good, so I hold little hope of something like Java streams API in the future.

Maybe someone can recommend a third party library.


I question the relevance of newer Java versions. Established codebases don't like to upgrade and new codebases are likely to use trendier languages.


Are we looking at the same languages? Java is far more a productive language with generics, lambdas, switch expressions, pattern matching.


Java (and C# and C++) have become kitchen sink sink languages. Everything is just thrown in. That makes it less productive for me. I've decided I don't want to carry around that much in my head all the time in order to read somebody else's code. I switch languages a lot these days.

Go is getting generics in (hopefully) in a few months. Some features are missing but most don't cause much pain and can be either simulated or worked around. Error handling is its biggest failure, but outside of that I find is at least as productive as other compiled languages in the same space.


> Java (and C# and C++) have become kitchen sink sink languages. Everything is just thrown in.

This is far from the truth when it comes to Java. Java doesn't add features willy nilly. They are thought out, and in general implemented better than in other languages. Java's WHOLE philosophy is to move slow and let other languages experiment with features so the kitchen sink doesn't get thrown in because Java has _actual_ backwards compatibility promises and has to support those features for eternity.


> Java is far more a productive language

Since when is productivity a priority for most developers? Seems like 2nd or 3rd fiddle based on HN sentiment these days.


Because they're two different languages, tackling different problems, with entirely different sets of benefits and costs associated with their use.


That’s not enough to justify the (10s, 100?) millions of dollars of investment. Java is faster and safe and can do everything go can do. C++ can be even faster (at least there are no pauses from a gc) at the cost of some safety.


The fact that Go has gained so much adoption probably justifies that investment. They are completely different languages and much of it is personal preference.


> Java is faster and safe and can do everything go can do.

Including generating static binaries without the use of requiring to download a runtime?


Yes, there were AOT compilers availbe for Java since 2000. But more recently, Graal creates very nice binaries.


Yup, with everything else being equal, given the choice I will always use the project written in Go.


Oracle.


Which increased the pace of development of Java and fully open-sourced it and is overall being a really great steward of the language? That Oracle?


No, the other one. The Oracle we hate and have hated for more than 20 years now.


Deployment story is a tentpole feature, of which these two have very different ideas.


Go will loose significant market share as soon as Java and .NET have a mature and usable AOT compiler.


Soon. Still, .NET Core is already faster even without AOT on most cases: https://benchmarksgame-team.pages.debian.net/benchmarksgame/...


I’m worried it won’t. There are an awful lot of people enthusing about how novice-friendly it is, who don’t seem to worry about wasting experts’ time rereading noisy boilerplate (which an expert should have abstracted out and generated instead).




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: