3 ms·
Having used Go a bit and Java heavily, I doubt it. The minimalist approach is opposite of what enterprises want for their general purpose language. Go is extre
by nullwasamistake 7y ago
Having used Go a bit and Java heavily, I doubt it. The minimalist approach is opposite of what enterprises want for their general purpose language.
Go is extremely verbose. I find myself writing a ton of "one off" single use code because the simple type system and lack of generics. The code may be easy to understand, but there's a real lack of flexibility compared to Java.
Lack of run time code generation support makes a lot of what Java does impossible. Most common libraries like Jackson, Spring, Hibernate, use runtime code generation and object proxies to make their interfaces cleaner. A lot of what they do would not be possible in Go.
Another big shortcoming in Go is lack of runtime analysis. In Java I can instrument code at runtime with almost no cost. Tons of tools like NewRelic use this to implement monitoring. Again, not possible in Go since the binaries are precompiled.
Then there's the nasty package system, but apparently that's being fixed.
The only strong contender to realistically replace Java is C#
- Thaxll 7y agoI don't think you used Go that much: - Go runtime analysis is as good a Java but 10x easier to use, and it uses way less resources than your Java equivalent ( JavaMissionControl, JMX, JVisualStudio, thread dump, Java Flight Recorder ect ... ) Have you tried to leave JFR on when running in production? I can run pprof / tracing with 0 problems, no corruptions of dump or hit on performance. - NewRelic instruments code using an SDK you have to integrate into your code, there is nothing magic, NR has also the same SDK for Go: https://newrelic.com/golang https://newrelic.com/golang - For the generics / package it's on the way to be fixed. For C# I agree. I think people don't realize how many companies are actually using Go on large project even outside of k8s / cloud world.
- Insanity 7y agoI hope go 2 does not introduce generics. Having used Java for about a decade (and C# 4 years) I can't say I miss it. And we use Go for a relatively big EHR program.
- owaislone 7y agoI hope they introduce it only if it keeps the language as simple as it is today even if it means generics will not be as powerful as other languages. I mean we have a ton of languages and Go is a unique one. If a project or team really needs generics, they can always use Java, Rust or something dynamic like Python or JS. I don't see much point in turning Go into another Rust or Java. Not that Rust or Java are wrong but with Go being so simple, we have all sorts of options. If it turns into another beast of a language just to solve what other language already have then we lose the simple and fast Go we all like.
- nullwasamistake 7y agoNewRelic installs itself as a Java agent, doesn't need any code integration it's just a command line param on app startup. That's one advantage of java, you can redefine classes at runtime. NewRelic uses Java Agent API to instrument code at runtime, no SDK or special build needed
- Thaxll 7y agoI'm not sure if we talk about the same thing, custom tracing: https://docs.newrelic.com/docs/agents/java-agent/api-guides/java-agent-api-instrument-using-annotation https://docs.newrelic.com/docs/agents/java-agent/api-guides/...
- nullwasamistake 7y agoYes, so you can annotate methods for additional tracing but the default agent alone provides a lot of metrics and it attaches using diagnostics API.
- prodprofiling 7y agoYes. I have indeed tried leaving JFR on in production. For many years. We even used to take chunks from the repo continuously (even though not supported). We solved 95% of our production problems with only the JFR data (with some contextual data recorded), rarely having to ask for other pieces of data or run special builds with additional one-off instrumentation. JFR is not only a production time profiler; but it is pretty awesome at that too...
- Gibbon1 7y ago> The only strong contender to realistically replace Java is C# I haven't used C# for a few years, being stuck deep in my firmware hole. But it sure seems like Microsoft is angling C# that direction. 'Open sourcing it' and making the language more and more cross platform. A consideration with enterprise software vs web scale infotainment spyware is the former; each transaction has a vastly higher value associated with it then the latter. And the life span of the software is much much longer. Go needs to be efficient because of the low revenue stream per transaction. And goggle doesn't care about maintence over the long haul because they rewrite and throw away code constantly. Vs enterprise where code is used for decades.
- nullwasamistake 7y agoGo aligns well with Google's frequent rewrite policy. C# is truly superior to Java in tons of ways, but adoption really hurts it's utility. The main driver for Java the last decade or so has been that it's good enough and has a library for anything. Need a DB driver for an esoteric datastore that died 12 years ago? Java has it. That's the selling point. It will take a decade or more of C# on it's current trajectory to catch up