4 ms·
How is it different than, say, java for this generalist purpose?
by kaba0 2y ago
How is it different than, say, java for this generalist purpose?
- colonelpopcorn 2y agoJust from an ergonomic standpoint it's a million times easier to deploy a go binary instead of a whole jvm and a jar file.
- pjmlp 2y agoWhen it is a pure Go application, only as CLI or UNIX server.
- Dansvidania 2y agojava on its own is not a competitor to go, IMO, due to the batteries included "culture" in the go ecosystem. I would need to compare it with, for example, Java + Spring(Boot). I find Go to be simpler and more pleasant to use.
- pjmlp 2y agoWhere is the GUI battery in Go?
- matwood 2y agoI agree with Go being simpler, but modern Java and Spring Boot is also fine. Backend programmers are spoiled with riches nowadays with all the completely workable options we have.
- vips7L 2y agoBatteries included but there’s not even a Set[T] in the standard library..
- lantry 2y agoIME, there are two main differences between go and java: 1) go is more "batteries included". Modules, linting, testing, and much more are all part of the standard cli. Also, the go stdlib has a ton of stuff; in java, there is almost always a well-built third party library, but that requires you to find and learn more things instead of just reaching for stdlib every time. 2) golang is "newer" and "more refined". this is pretty subjective, but golang seems to have fewer features and the features are more well-planned. It's a more "compact" or "ergonomic" language. Whereas java has built up a lot of different features and not all of them are great. You can always ignore the java features you don't like ofc, but this is still a bit of cognitive overhead and increased learning time.
- nerdponx 2y agoThere are surprisingly few languages in this category, especially if you limit consideration to statically typed. Go, C#, Swift? Nim, Crystal? F#? Kotlin? Go is not my favorite language, but it really is exceptional in terms of its effective utilitarian design.
- hughesjj 2y agoEh, imo the go libraries still aren't up to par with out of the box java libraries. Like there's still no Set class, nor the equivalent of Map.keys. yeah they're easy to write but that's still not an included battery. Also, while the cli to add stuff is useful, there's still nothing to the level of maven or gradle for dependency management, and I usually find myself doing some fun stuff with `find -execdir` for module management. Different strokes for different folks though. Java (really, kotlin) still makes a ton of sense for backend to me given how the jvm is architecture independent and you don't have to make tradeoffs/switch to graal if it's a long lived service. Golang is nice, love it, but it's still got a bit to grow. I'm just happy they added modules and generics. I don't think it's a matter of being 'well thought out' as much as it's a simple language that cares a lot about simplicity and backwards compatibility and has iterated ever since. For my the killer app isn't go routines so much as you can produce a binary that's resilient even to shared/dynamically linked libraries in all platforms, which is awesome for portability independent of environment. No more gcc vs clang vs msvc headaches, no more incompatible shared libraries, no more wrong version of jvm or a bad python modules path etc. Oh, also java had like a 15 year headstart on golang, and it wasn't until java 8 that many of my biggest complaints were addressed. And yeah stuff like apache commons +log4j+mockito/junit are pretty much required dependencies, and maven/gradle aren't language native. The best STL is probably python imo but even that doesn't support a proper heap/priority queue inplementation. For data structures specifically I think java/kotlin has the best STL. All of this ignoring .NET or apple platforms.
- duskwuff 2y ago> Like there's still no Set class map[T]struct{} ?
- aaomidi 2y agoDependencies in Java are a pain in the ass. Publishing libraries for your own consumption is even harder. Publishing libraries for world consumption means now you also need to be a PKI expert.
- conor- 2y agoAs someone who isn't super proficient in Java I usually find Java daunting to get started with full of buckets of "meta" issues like in my other comment. What JVM do I use? Does it matter? Does it matter what version I install, what if I have to install/manage multiple versions? If I want to write a web service can I use vanilla Java stdlib or do I have to use Spring or some framework? If I use Spring, do I have to get into the weeds of dependency injection and other complexity to actually get my app off the ground? With Go, none of those questions exist. I install the latest Go, create a main.go file, I use net/http and I'm off to the races.
- neonsunset 2y agoI think it's good that Go, among other well-made toolchains, brought attention to importance of good CLI UX. But it's not something that is unique to Go: dotnet new web dotnet run curl localhost:5050 also 'dotnet watch' for hot-reload.
- pjmlp 2y agoBesides what neonsunset points out for .NET world, where alongside C#, we get the pleasure to enjoy F#, VB and C++/CLI, it is relatively easy for Java. When one doesn't know, just like with Go, one picks up the reference implementation => OpenJDK. For basic stuff, the standard library also has you covered in the jdk.httpserver module. By the way, where is the Swing equivalent on Go's standard library?
- simon_void 2y ago> What JVM do I use? latest LTS (longterm-support) version, so currently 21, next 25 (late 2025). > Does it matter? new is always better > what if I have to install/manage multiple versions? https://sdkman.io/ https://sdkman.io/ > If I want to write a web service can I use vanilla Java stdlib or do I have to use Spring or some framework? Spring > If I use Spring, do I have to get into the weeds of dependency injection yes, but it's not hard (or I've done it long enough) > other complexity that might just be inherent complexity when have to deal with a webservice. personally I dislike have to configure security So basically go to Spring Initializr (https://start.spring.io/ https://start.spring.io/) pick the latest LTS Java&Maven (or Kotlin&Gradle-Kotlin) and You're off to the races.