5 ms·
Wow, I'm surprised to see the typical "Well, why didn't you just use Rust" comment hasn't been posted. At the end of the day, it sounds like they just had some
by alfalfasprout 8y ago
Wow, I'm surprised to see the typical "Well, why didn't you just use Rust" comment hasn't been posted.
At the end of the day, it sounds like they just had some clunky C++ code that was due for a rewrite anyways (and the author admits as much). If you don't need it to be ultra low latency, some nice abstraction and modularity can already do wonders.
I've found Go to be an excellent Java replacement when all is said and done. Great for the vast majority of services you might write. But if you need to do anything lower level or that involves complex type logic you always end up with a clunky solution (and I'm not going to sing any praises for C++ having an elegant solution either).
That said, modern C++ (especially 17) can be made to look decently clean and without weird behavior in most cases. Yes, there's always the person that shows up and points out weird edge cases that you can run into but the situation is far, far better than it was years ago. With some good engineering practices in encapsulating low level optimized code you can largely limit the "danger surface" of your codebase.
- pjmlp 8y agoWhen Go gets around supporting Java generics, dynamic loading, JDBC, PDF generation libraries, Office/LibreOffice manipulation libraries, Akka, CMS platforms, BluRay/SIM CPUs, a phone OS, a GUI library comparable to AWT (lowering the level as Swing/JavaFX/Android aren't even around), JMX instrumentation, hot code replacement.... then maybe just maybe, it is an excelent replacement for Java.
- laumars 8y agoI can't tell if it's intentional but your post borders on fanboyism given about 80% of what you listed there is either already available for / possible in Go or is a Java specific term so naturally Go would have it's own mature libraries out there under a different name. For example * JDBC, Akka, etc There as all Java specific technologies but that doesn't mean that Go (nor any other language) doesn't have their own libraries to do the same. I mean you're not going to call Go's database libraries "Java Database Connectivity" are you * PDF generation libraries, Office/LibreOffice manipulation libraries, CMS platforms, Go already has all that * a phone OS, There isn't any phone OS's written in Java either. There are phone OS's that use Java as their preferred application runtime environment - such as Android - and many of them can and do support running Go binaries as well. There is in fact a lot of documentation online regarding running Go on Android. --- I'll grant you that Go doesn't have hot code replacement nor generics but the former is a pretty niche case for Java development that wouldn't really improve Go's current workflow anyway - and the latter is such an tired old argument that you're not going to win any debates by pointing it out. Disclaimer: I've programmed in both Java and Go (as well as more than a dozen other languages too). So I'm about as agnostic as they come when it comes to evaluating programming languages.
- pjmlp 8y agoSo where are the Go drivers offering 1:1 feature parity with JDBC for Oracle, DB2, SQL Server, Informix....? An example for cluster based distributed framework similar to Akka in features? What Go libraries provide feature parity to PDFJava, iText or POI? Which Go CMS is comparable in features to Literay, Adobe Experience Manager? Where is Go listed here? https://developer.android.com/guide/platform https://developer.android.com/guide/platform
- laumars 8y ago> So where are the Go drivers offering 1:1 feature parity with JDBC for Oracle, DB2, SQL Server, Informix....? > > An example for cluster based distributed framework similar to Akka in features? > What Go libraries provide feature parity to PDFJava, iText or POI? > Which Go CMS is comparable in features to Literay, Adobe Experience Manager? Clearly I'm not going to waste my entire afternoon doing research for you just to win some internet points. Particularly when you're just going to find some other "irrefutable fact" to lord over Go thus making any sensible discussion pointless. Actually I'm going to agree with you on one thing: while Go does support all of the above I'm sure there will be some specific edge cases that are available in a Java library - eg PDFJava - that isn't available in an equivalent Go library. However I'm also confident I could list of some edge cases that are covered by Go and not Java. Anyone with the slightest bit of level headedness would agree that you're not going to get 1:1 feature parity with every competing library in competing languages because different developers will prioritise different features. So you accomplish nothing by making such an argument in the first place. > Where is Go listed here? > https://developer.android.com/guide/platform https://developer.android.com/guide/platform Why would it be listed there when Go doesn't target libc nor the JVM? That page also doesn't list about dozen other languages nor frameworks that also support Android.
- pjmlp 8y agoThe point was that Go is supposedly an excellent Java replacement, yet it's ecosystem is found lacking in comparable libraries. As for Android, the whole userspace and a big part of Treble drivers are written in Java, which was exactly the point of being a phone OS written in Java. So excellent replacement for Java? Not really.
- AndrewSChapman 8y agoIf you haven't tried Kotlin, you really should. It's a highly expressive, null safe language with all the goodies you'd want without the bloat of Java. For web services, Kotlin + Vert.x + Postgres is a beautiful and highly performant thing.
- nicoburns 8y ago> That said, modern C++ (especially 17) can be made to look decently clean and without weird behavior in most cases. The issue is when you need a library, it becomes much harder than in pretty much any other language. And your library probably isn't written in your nice clean subset. > I'm surprised to see the typical "Well, why didn't you just use Rust" comment hasn't been posted. Rust only hit 1.0 midway through 2015, so it was a bit early for that.
- d33 8y ago> Wow, I'm surprised to see the typical "Well, why didn't you just use Rust" comment hasn't been posted. https://news.ycombinator.com/item?id=19387279 https://news.ycombinator.com/item?id=19387279 Also, yours seems to count as well. I think it's fine to compare languages - some features can be best described by contrasting them with others.