9 ms·
Exception 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
by arein3 3y ago
Exception 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.
- throwaway2037 3y agoI too dislike dependency injection frameworks. I try to always wire manually myself. I'm tired of debugging old SpringFramework apps where changing the JVM by a patch level or changing one JAR dependency breaks the wiring. I have seen it too many times to count.
- jmauritz 3y agoIf all you have is spring boot, everything looks like a spring boot problem.
- eastbound 3y agoPlus Spring is honestly quite badly programmed. The pagination object is bulky and unnecessarily complex, where a simple offset/limit is enough (and a nextUrl for cursor-based access). When we looked into cluster locks, they’re not even released if one node goes down. I mean, who would need a lock implementation that just stores a line in a DB? And the doc doesn’t even warn about it. Apache contributors were much better-skilled.
- throwaway2037 3y agoApache contributors were much better-skilled. That is quite a broad statement. Two negative points about Apache Java libraries I can think of: The original "lang" libraries have not aged well at all. Also: The HTTP client libs are a fiasco. Very challenging APIs and weak documentation.
- pjmlp 3y agoOriginally prototyped in Java, rewritten in Go when a couple of advocates joined the team.
- pm90 3y agoNot really. Software first enterprises do. But most enterprises that have a non-software focus generally prefer languages that have been around for a while and are known by lots of people.
- cdogl 3y agoI’ve written go code for large corporates in Australia who absolutely did not have a tech or software focus. One was a notoriously bureaucratic company which used to be a government owned enterprise. For the niches it fills well, it’s become almost ubiquitous. With regard to this: > But most enterprises that have a non-software focus generally prefer languages that have been around for a while and are known by lots of people. I know developers who work for large blue chip financial sector and other traditional sectors. They’re on the same React/Vue/Webpack/whatever treadmill as all the frontend devs devs working at web dev agencies. And they’re often compiling it down from TypeScript, which has not been around for a very long while at all and is not known by lots of people (relative to the size of the JS community. Swinging a bit of Go for a service in an environment like that isn’t really that hard.
- anoy8888 3y agoWow
- winrid 3y agoThe programmers don't make that call. The CTO does, so they can hire anyone.
- housemusicfan 3y agoBy enterprise he means non-webshit industry.
- neonsunset 3y agoJava is an inferior language to C#. To get a superior language you would likely have to go for Kotlin. There is no comparison, because Java gets features today that C# had for years. Not even mentioning having to retrofit green threads because adopting async/await (used by TS, Rust, Swift and other languages) is impossible at this point.
- throy930493 3y agoC# is a better language, but the JVM is a significantly better ecosystem. Java will always be behind (and type erasure for generics is annoying enough as someone who started in C# that I don't think it will ever catch up) but between hotspot and being the preferred language of 2/3rds of the clouds I think it clearly wins.
- deleted 3y ago[deleted]
- anoy8888 3y agoIf you like jvm, use closure instead.
- hmottestad 3y agoSorry you’re down voted. Closure might not be what the author is looking for. There are a lot of languages you can use with the JVM, Closure is one of them, Groovy, Scala and Kotlin are some more. Kotlin is gaining a lot of traction, especially since it’s backed by JetBrains.
- sgt 3y agoClojure*
- deleted 3y ago[deleted]
- bcrosby95 3y ago
- turndown 3y agoGo has had generics for more than a year now
- latchkey 3y agoNot even in the same league as Java.
- simon_void 3y agoI agree, Go has had generics for a little while (of course they are different from Java's generics because Go's type system is different from Java's type system) and I don't think the parent comment writer was aware of that.
- throwaway2990 3y agoThis is definitely one of those. “Tell me you don’t know .NET with out telling me you don’t know .NET” moments.
- guideamigo_com 3y agoAfaik, no language as great of exceptional handling as Java. I prefer Go but I have to admit, Java's checked exception handling is amazing.
- iopq 3y agoChecked exceptions are gross, they get in the way when you're prototyping, and you end up just ignoring them anyway (since you're prototyping)
- quelltext 3y agoThe ergonomics of checked exceptions may be debatable but compared to golangs explicit error handling at essentially each function call is definitely worse.
- peterashford 3y agoYeah, I've got a lot of Java experience and a wee bit of Go language experience and I agree with you. I like Go in almost every way except for it's error handling. It's just wrong to have to check every goddam function one by one
- pkolaczk 3y agoI guess that's the reason why most Java programs I use cannot do proper user-facing error messages. Because it is so easy to just ignore error handling. The exception will be caught by the top-level, right? This is how almost every Java cli tool prints a stacktrace on even most trivial user errors like file not found. Having to deal with errors and forcing the developer to do proper error handling is a good thing.
- ArandomAccount2 3y ago[dead]
- guideamigo_com 3y ago
- mseepgood 3y ago> Exception handling and generics are missing key pieces from go. But adding them will make go look like java. You know that Go has generics since a couple of years now?