Hacker News new | ask | show | jobs
by dunefox 2230 days ago
> I abhor the Java ecosystem for so many reasons I just don't have the energy to go into.

If you can gather some energy, I'd be interested in that.

2 comments

Like I said there's nothing wrong with the stack. I was ONLY speaking of my personal preferences why I choose not to Java when I can Go: Just personal preferences.

-- Compile times!

-- Operational complexity vs. Go.

-- Built-in tooling vs. Go.

-- Verbose XML configuration files.

-- Lots of libs favor XML vice JSON.

-- Deeply-nested code directories.

-- Class-centric model (only).

-- Verbosity and boilerplate.

-- Factories of factories of factories. :)

-- JVM install and config (many dials = control but also complexity).

-- Impractical / painful to write without an IDE.

-- Concurrency model, as compared to Go.

-- Std lib not matched to work I use Go for.

-- Memory consumption.

-- Performance (for the work I do).

-- Multiple inheritance (allows unnecessary complexity).

-- https://astaxie.gitbooks.io/build-web-application-with-golan... vs. https://medium.com/@ssaurel/create-a-simple-http-web-server-...

-- Oracle.

(edits: reformat pretty; compile times)

> -- Compile times!

golang compile times are similar for any non-trivial project. Ironically, they're even much worse than Java's for quick changes (e.g. change a single file then recompile to run tests) since golang has to spit out a binary that is in the 10s of MBs compared to Java which just needs to change a single class file.

> -- Operational complexity vs. Go.

The JVM is superior for operations, observability, and monitoring to anything that golang has to offer.

> -- Verbose XML configuration files. > -- Lots of libs favor XML vice JSON. > -- Factories of factories of factories. :)

Nothing to do with the language.

> -- Deeply-nested code directories.

I've seen the same in golang code due to its packaging.

> -- Verbosity and boilerplate.

golang is more verbose and error prone for any non-trivial code base

> -- JVM install and config (many dials = control but also complexity).

The JVM is configurable and gives the user the ability to tune his program (say latency vs throughput), unlike golang which doesn't. Secondly, you can compile to native code using GraalVM.

> -- Concurrency model, as compared to Go.

Java is getting green threads (see project Loom), and they'll be superior to what golang offers.

> -- Impractical / painful to write without an IDE.

Irrelevant for any non-trivial code base, since golang needs and IDE as well.

> -- Std lib not matched to work I use Go for.

let's see what golang has to offer anything remotely similar to java.util.concurrent.*

> -- Memory consumption.

Depends on how you set up your JVM (Xmx, GC settings, etc.). Java is getting value types soon to address this even more.

> -- Performance (for the work I do).

They're on par, and for any non-trivial code base, Java tends to be faster.

> -- Multiple inheritance (allows unnecessary complexity).

Java doesn't support multiple inheritance.

Reading this, it honestly looks like you don't know how to write Golang and wish you could write more Java.

That's fine but pretending you're an SME and throwing off false equivalencies is really dishonest.

I know how to write golang, which is why I'm well aware of its shortcomings and the issues its inferior design causes, and the costly bandaids that have to be implemented to poorly attempt to mitigate said issues.
Got an example repo you've worked on as happy to help work with the ecosystem rather than against it?
It's a non-public code base.
> -- Operational complexity vs. Go.

The JVM is superior for operations, observability, and monitoring to anything that golang has to offer.

>> Disagree on operations part. Take a bare machine and with various configurations (some you don't control) and be ready to drop and run. Nothing beats Go. You cannot be simpler than copy a binary. Yes, the JVM has all sorts of observability. And also a load of tuning that often needs to occur. Go just runs and generally has outstanding performance.

> -- Deeply-nested code directories.

I've seen the same in golang code due to its packaging.

>> Go code is generally not as deeply nested. Often you have <project>/<package>/<file.go>. Not stuff like:

tomcat/java/org/apache/tomcat/websocket/server/xxxx.java

> -- Std lib not matched to work I use Go for.

let's see what golang has to offer anything remotely similar to java.util.concurrent.*

>> Friend, I'm talking about all the packages here: https://golang.org/pkg/

> -- Memory consumption.

Depends on how you set up your JVM (Xmx, GC settings, etc.). Java is getting value types soon to address this even more.

>> Yes, mu point (Xmx, GC settings, future things). Many dials == complexity.

> -- Concurrency model, as compared to Go.

Java is getting green threads (see project Loom), and they'll be superior to what golang offers.

>> More Java getting/future vs. Go has today. "they'll be superior to what golang offers." Since we are predicting the future, can I also get next week's S&P500 level for my trades?

>> Let me know when you can remotely close to writing <200 LOC that can handle 1m websocket connections from a laptop. There are 2 source files here. https://github.com/eranyanay/1m-go-websockets/tree/master/4_...

Again as I opened with, these are my experiences. If Java and the future versions of Java and the tolling, IDEs, CI/CD tools, inspectors, etc, work for you. Great. Have at it.

I will keep deploying rock solid Go applications with minimal complexity and maximal performance/reliability, out of the box. I shall enjoy flatter code trees, working without a IDE when necessary (totally possible), enjoying simple make files for builds, and solving a ton real world problems with minimal external libraries (again, dependencies ~= complexity ~= risk).

Checkout some great stats from the 2019 Go Survey here: https://blog.golang.org/survey2019-results

I will depart with a final thought about Go: Why are increasingly more and more web-scale infrastructure projects being written in Go? (CockroachDB, Openshift, NATS, Docker, Istio, Etcd, Docker, K8S, large parts of AWS, Azure, and CGP).

Because of cargo cult of "must be web scale" and people that want to pump up their CVs to work at a FAANG.

All those projects are related to Docker and k8s, so naturally get written in Go.

Thankfully it is also possible to use Rust, C++, Java and .NET with them without writing a single line of Go.

You could write any program in any non-toy language, of course. This does not make every language a good choice for a given problem.

Here’s some pretty detailed notes from Google about one high volume project they rewrote from C++ to Go.

https://talks.golang.org/2013/oscon-dl.slide#1

Use whatever language you like. Just because you like X and someone else likes Y does not invalidate either language.

And to you totally off base comment about cargo cult of web scale and ‘pump up their CVs’ .... in my case I happen to work with huge data (petabytes) so yeah it matters and has nothing to do with FAANG. In this context I have found Go to be an insanely great tool—-productive, reliable, maintainable, multi-core, networked and fast. Thankfully I will never have to write a line on .NET.

Ah the rewrite that was driven by the Go team itself as a means to prove a point.

Apparently the Android team did not adopt gomobile the same way.

Same!! Although, an experienced C++ dev might just abhor the thought of pointer chasing everywhere, even if it's not a big deal in 90% of web backends.