News for hackers. Stuff that matters.
Re:Go: What We Got Right, What We Got Wrong by zozbot234 on Thursday January 04, 2024 @09:13PM (#38874903)
That's nothing new, Java successfully replaced C++ in enterprise code in the mid-to-late 1990s. Because it was safe from memory bugs.
Re:Go: What We Got Right, What We Got Wrong by lanstin on Thursday January 04, 2024 @09:33PM (#38875041)
Mid 2000s in my experience. And not because it was safe from memory bugs so much as safe from memory leaks. Still had plenty of NPEs.
Re:Go: What We Got Right, What We Got Wrong by justinclift on Friday January 05, 2024 @01:51AM (#38876485)
Java kind of gets around the memory leak problem by allocating all of the leak up front for the JVM. ;)
Re:Go: What We Got Right, What We Got Wrong by cryptos on Friday January 05, 2024 @02:18AM (#38876604)
I'm a JVM guy, but this is a good one :-)
Re:Go: What We Got Right, What We Got Wrong by pjmlp on Friday January 05, 2024 @02:56AM (#38876793)
NPE isn't a memory corruption bug.
Re:Go: What We Got Right, What We Got Wrong by kaba0 on Friday January 05, 2024 @07:40AM (#38878486)
Those are safe.

And it’s not like Go didn’t just copy nulls (plus even has shitty initialization problems now, e.g. with make!)

Re:Go: What We Got Right, What We Got Wrong by worik on Friday January 05, 2024 @03:43PM (#38884631)
Java is safe from a class of memory bugs and leaks

It is still possible to leak resources in Java

You have to fool the GC but it is surprisingly easy to do.

Re:Go: What We Got Right, What We Got Wrong by Cthulhu_ on Monday January 08, 2024 @05:05AM (#38910059)
Safer, I'd say, but it also introduced its own issues. Its type system and - maybe more importantly - its ecosystem around things like unit testing and static analysis at the time was a few leaps ahead of C++, making it a favorite for enterprise systems and codebases where getting 5 SIG stars is a badge of honor and/or requirement.

Java is easier than C++ as well, harder to mess things up. That said, Go feels easier again than Java because it got rid of a lot of cruft.