16 ms·
I don't think any existing Go developer is going back to Java. I worked with Java for 10 years and switched to Go and I will never go back. This is mostly bec
by impulser_ 3y ago
I don't think any existing Go developer is going back to Java.
I worked with Java for 10 years and switched to Go and I will never go back.
This is mostly because applications and libraries are so hard to reason about and understand due to inheritance, packaging, OOP, build tools ect compared to Go.
Go is simple. It's easy to understand, read, and maintain. The packaging is like how you would package files on your computer in single folders. The tooling is built into the language. You don't need a IDE like IntelliJ just to make it feel reasonable to work with.
Maybe all of this has changed, but most of the libraries I see in Java today still look like this.
- kaba0 3y ago> This is mostly because applications and libraries are so hard to reason about and understand due to inheritance, packaging, OOP, build tools ect compared to Go. You are just at the early phase of the project. > Go is simple. It's easy to understand, read, and maintain My opinion is that Go is too simple, to the point that it hinders understanding and readability. 4 nested loops with random mutability is much worse than a clear Stream api "pipeline". The 31st if err check will not be actually handling the underlying problem, while you can't forget about Exceptions -- even if they do bubble up to the main app, you will clearly get an actionable stacktrace. > The tooling is built into the language This has benefits, I will give you that. At the same time, I think all these new build tools are anemic and can't be used for anything more complex than interacting with the same language's standard dependencies. Gradle is not sexy, but is actually capable of doing any kind of build.
- nonethewiser 3y agoIm convinced Go is just an incomplete language masquerading as a simple one.
- acje 3y agoI wonder if replacing the type system in Go with the one in Rust and adding native Actor model support would be doable. Or if GC and compile time would regress too much. Modern languages without good sum types just seems like such a lost opportunity to me.
- kaba0 3y agoWhat would be the point? Why stick with Go if you want so deep-reaching changes?
- vmfunction 3y agoThat what I often wonder, if one is going to start using a new language why go? Rust at least it gave one memory safety and not having to use GC make it more stable usage of resource as the discord article have already pointed out. Seem like go is just google's .NET, every big corp need to have their own language.
- goldinfra 3y agoGo is a complete and simple language, and this is a fairly objective claim. Unless by "incomplete" you mean it could have more features. But C++ and Rust (and Java) have been piling on features for years, with no signs that they will ever slow down or stop, proving that they're also "incomplete" by this definition. IMO this is really just a result of there being too many cooks in the kitchen, and a lack of leadership committed to saying "no" to feature requests. This is also why using Rust or C++ requires every organization to agree on a subset of the language they will utilize. Rust isn't as far along this path, but it's heading in the same direction as C++. But with Go, every organization can use the complete language. That's how simple it is. Go has been used by many organizations to build stable, large, and scalable systems that have been operating successfully in production for many years now. That's how complete it is.
- tuyguntn 3y ago> You are just at the early phase of the project. Lately, I am seeing very few codebases getting supported more than 3 years in companies offering software products. Every 2-4 years services are getting rewritten, what's the point of having tool intended for 15 years, when services are deprecated in 4 years
- __MatrixMan__ 3y agoIt would be good for my job if learned go, but I've been having a hard time because it's just so boring.
- kakwa_ 3y agoHonestly, just find yourself a project and just Go for it (sorry for the pun). The syntax is easy enough you can start coding just after having looked at basic examples. Personally I actually like Go because it's so boring. I tend to see languages more like tools rather than valuable knowledge I must learn, so a simple yet powerful enough language is a perfect fit for me.
- goldinfra 3y agoYou're doing it wrong if you think programming for work is about the code being a means of expressing your inner soul. The most successful professional programmers derive their enjoyment from achieving business objectives, like making products that users love and improve the world. If you want to express your soul in your code, do that on the weekend using whatever language you want. Trying to mix these motivations is a recipe for disaster.
- deleted 3y ago[deleted]
- __MatrixMan__ 3y agoI have too much skepticism of "businesses objectives" to be especially interested in success. I want something that'll bend my mind.
- nemetroid 3y ago> The most successful professional programmers derive their enjoyment from achieving business objectives, like making products that users love and improve the world. Successful by what metric? Achieving business objectives? I don't necessarily disagree with the point, but this seems like a truism.
- 3y ago
- kamaal 3y ago>>You are just at the early phase of the project. Nah. 99% of the code written out there doesn't need layers of indirection, responsibility tossing around, Code splitting across classes, design patterns, inheritance and the class jungle that is common in Java. Rise of languages like Go is simply majority of the people realising when they want X, they are better of writing just X. You don't have to write a generic version of X that needs to work in a dozen situations. This is for a simple reason. Most of the times, there are no dozen situations. Most, not all the times. Most of the code I write, doesn't change all that much. If you are writing code that needs to run for decades in an industry where grifting and job hunting is a daily affair you are doing it wrong.
- 4m1rk 3y ago> Most of the times, there are no dozen situations. After 20 years of building all sorts of software, I know that this a fact, but the challenge is to make others aware of it.
- deleted 3y ago[deleted]
- arein3 3y agoException handling and generics are missing key pieces from go. But adding them will make go look like java. I just wish java would add null safety in the type system in a first citizen way. For enterprise use java has no competitors. You have c# which is microsoft trying to estabilish nash equilibrium fu*ing the developers. I am a bit worried about ever increasing complexity and a steep learning curve, but seems like this is a problem on all fronts.
- kaba0 3y ago> I just wish java would add null safety in the type system in a first citizen way With valhalla (value types), it might just come!
- rcme 3y agoWhat is “enterprise” use? Plenty of enterprises use Go.
- arein3 3y agoBy enterprise I mean a lot of features related to data consistency, scalability and integrations. I do not know about go ecosystem, but java and spring have mature solutions that cover the most advanced use cases.
- Thaxll 3y agoKubernetes is what I would call very advanced use case. But that's the thing with Java, yes there are libraries for everything and one could see that as a problem actually. Spring was mentioned before, but it's the perfect example of an overengineered/ heavy library that does a lot of black magic.
- bcrosby95 3y agoJava is strange because it can be both verbose and magical at the same time. Just the other day I ran across an issue where spring was wiring things up correctly on Linux but not Windows.
- totallywrong 3y ago> Go is simple. It's easy to understand, read, and maintain. Matter of taste I guess, to me Go code looks ugly, it's too verbose with all that error handling every other line which hurts readability. Also the docs are often so cryptic and unhelpful, one needs to rely on examples elsewhere. I do use it though, when I need something fast in a single binary.
- speedgoose 3y agoMy main pet peeve with Golang is to use single letter or very short abbreviations when naming variables. The Golang documentation recommends what is considered a bad practice by most programmers communities.
- waffletower 3y agoYes, short abbreviations are brutal in long sprawling code contexts. Write in a compact, functional, and readily unit testable coding style, and those tiny variables reduce your cognitive load and bring great clarity. Use comments and/or docstrings to provide context for compact parameters and local variables once, rather than implicitly documenting with every usage.
- ctxc 3y ago>Use comments and/or docstrings to provide context for compact parameters and local variables once, rather than implicitly documenting with every usage. Context that isn't documented with every usage is context you need to remember. Trade off, but I'd much rather not have to remember multiple contexts for the same name every few hundred lines.
- classabove 3y agoAre you specifically referring to method function receiver type annotations? Those are often left shorthand but shouldn't exist out of the type definition file anyway eh?
- 3y ago
- anoy8888 3y agoThis is correct. It is about culture too. Java is the kind of language that attracts some mediocre programmers who produce mediocre code based on the wrong ideas of object oriented programming. of course, there are great Java programmers. It is just that a better programming language would help average programmers like us to achieve more
- sverhagen 3y agoYou're entitled to your opinion. I guess I must be a mediocre programmer then. (Don't forget that 90% of developers thinks of themselves as above average.) But if Java can evolve, why wouldn't its practitioners?
- x86x87 3y agoThat escalated quickly. There are good and less good people everywhere and using language X does not automatically tell anything about you. If anything I think the cases where you can use Go successfully are only o fraction of the cases where you can use Java successfully. It's not necessarily Java itself but the ubiquity of the JVM and its ecosystem (see Kotlin, see Scala as examplea that have leveraged this ecosystem successfully)
- blq10 3y agoSo the ideal blub language will be whatever language is too new to really be the legacy thing with tons of black magic you just have to know, but also too old to include tons of new ideas in language design the programmer has to grapple with. Old languages force you to understand really core issues because the stack is 1m+ lines of code and you need an operating model for all that magic. New languages do the same thing, but it's because half the really good stuff is <experimental> Python and JS are in the current sweetspot, go is up next, and after that, Rust.
- riku_iki 3y ago> the cases where you can use Go successfully are only o fraction of the cases where you can use Java successfully could you elaborate why do you think so, and maybe give examples of cases where Go can't compete with Java?..
- hota_mazi 3y agoGo gives you the illusion of simplicity because it gets rid of guard rails and error checking. If you remove all error checking, of course your code is going to look a lot simpler. It's also going to be a lot more wrong and crashy. Wait until your code base grows, your team grows to >10 developers, and you will understand what I mean. Java (and preferably Kotlin) are a lot more serious about making sure your code is robust before it compiles.
- segfaltnh 3y agoWait, are you implying Go doesn't have error checking? In what way? It has famously verbose error semantics.
- za3faran 3y agoIt's verbose yes, but also more error prone.
- _ZeD_ 3y agowell... https://github.com/search?q=%22f%2C+_+%3A%3D+%22+language%3Ago&type=code https://github.com/search?q=%22f%2C+_+%3A%3D+%22+language%3A... 98k results...
- coryrc 3y agoNo exhaustive enum checks. No Option type, so you can still use results of a function if it returns an error.
- sgloutnikov 3y agoI've heard this argument before, and I point out Kubernetes to them. Is that code base complex enough, because it's pure Go doing just fine and runs on plenty of systems?
- troupo 3y agoYou can point to a complex project in any language, and that would prove nothing.
- whateveracct 3y agoGo also sucks. It's so easy to leak threads.
- synergy20 3y agoGo's major selling point to me is that you can ship one binary, nothing beats that. Python, Node, Java all have to pre-install lots of dependencies before you can use them, fine for developers, not so great if you want to distribute software for people who are not software savvy, who typically just wants to download one file, install and start using it. c and c++ can also do one executable, but, it is not as portable as Golang, and not as static-link friendly as Golang.
- ashishb 3y agoFully compiled languages have another huge advantage. If you write a tool in Python and targeted say Python 3.10 then people using Phython 3.9 might not be able to use it. So, you really can't use latest and greatest features of Python 3.11 or 3.12. However, with Go, you can build your tool in Go 1.21 or whatever, and the user does not even need a Go toolchain on their machine. I was planning to write a small side-project to generate GitHub Actions boilerplate. And this time, I intentionally chose Go for that exact reason. https://github.com/ashishb/gabo https://github.com/ashishb/gabo
- pjmlp 3y agoUnless dynamic linking is used, or OS APIs change between version, or specific OS files change location.
- iampivot 3y agoComing from Spring Boot with it's 17+ level deep abstractions to Go / gin-gonic was such a breath of fresh air!
- _ZeD_ 3y agoWith the little difference that spring boot offers you 99% of your needs, both to fetch the data from (sql, nosql, you-name-it), and to offer your interface out (web, rest), and programming style (syncronous, asyncronous), and observability, .... while for go you'll find yourself deep in the mud of choosing what 3rd part library to use for logging and how to make it work with the rest of custom stuff you have to write
- kartoshechka 3y agoit's kinda funny to me when people with latest macbooks, loaded with actually useful but comically expensive programs, open up goland that itself has a shit ton of features, to write some error handling in go
- nprateem 3y agoI went the other way as I was sick of all the repetition in Go. Spring boot/JPA data repositories save so much SQL, and spring boot automatically marshals to and from JSON, form data, etc. It means you can just work on the meaningful business logic. Add on Lombok and there's even less to maintain.
- nradov 3y agoI never understood some of the objections to inheritance. It always made it easier for me to reason about the code, not harder.
- FpUser 3y agoSome people are aware about various concepts/paradigms and are able to put each to good use where appropriate. Other follow fashion and if some dick looking for fame declares A as obsolete and B as the new and shiny one (to be replaced soon anyways) then the lemmings would follow and sing the gospel.
- pjmlp 3y agoGo is Java 1.0, nowadays 1.5, as they thankfully finally at least added some support for generics. I am not touching Go, other than on the projects I have some customer or higher up telling me to do so.
- nine_k 3y agoGo has made many decisions that i'm not happy about. If they did one thing exactly right on the language level, it's the [lack of] OOP: interfaces in their implementations, and no inheritance, overridden methods, covariance / contravariance games, etc. You can of course write in Java in that style: only extend interfaces, never inherit classes. But many libraries, including the standard library, actively refuse to cooperate.
- deleted 3y ago[deleted]
- nprateem 3y agoAnd yet even after writing Go for 5+ years I still have to Google for what actually implements Reader so I can read a file, etc.
- aarbor989 3y agoDo you mean overloaded methods? You can "override" methods in Go in the sense that if you have an embedded struct you can provide your own implementation in your struct to use instead
- jpgvm 3y agoI did. Did Go professionally for ~5 years and went to JVM. Go is easy, but it's surface level easy. Building and maintaining large applications in Go if you don't have a huge team is a giant pain. JVM (especially paired with Kotlin) for me atleast has meant regaining the expressivity I was missing from Ruby and Python when I moved to Go whilst retaining (well actually usually beating) it on performance and scalability. I lost absolutely nothing to go to JVM but gained so many things.
- cies 3y ago> JVM (especially paired with Kotlin) I agree the Go lang compiler/runtime needs "a Kotlin", with more null-safey build in, proper sum types, a std lib that makes heavy use of null-safety and sum types, better story for polymorphism, better ergonomics for writing stream pipelines, and additional compilation targets (like JS, WASM). This all while proving stellar interop with all Go code, obviously. Kotlin is quite a sweet deal.
- chrisdinn 3y agoCurious to understand what you are suggesting here. What’s a better story for polymorphism than duck typing? What would (better?) null-safety look like in Go?
- cies 3y agoI'm saying that we need an XYZ to Go what Kotlin is to Java. The I name some ways that Kotlin improved upon Java that Go would also benefit from. > What’s a better story for polymorphism than duck typing? Something that give compiletime guarantees and has not runtime overhead. > What would (better?) null-safety look like in Go? https://kotlinlang.org/docs/java-to-kotlin-nullability-guide.html https://kotlinlang.org/docs/java-to-kotlin-nullability-guide...
- anacrolix 3y agoGoing on 12 years with Go and agree with everything.
- 3y ago
- sgt 3y agoThis is also the killer argument for going Python, by the way. Go is going to be much faster, of course, but you can still scale quite well with just going Python. And sometimes / most often you don't need scale.
- datavirtue 3y agoLol...you use the language most appropriate for the given situation. What's appropriate in the browser....hmmm. Can't slam your foot down on that one.
- mx_02 3y ago> The packaging is like how you would package files on your computer in single folders How does that vary from Java?
- aarbor989 3y agoI use Go and Java every day, and Java is way more enjoyable to use
- sproketboy 3y ago[dead]