7 ms·
Go 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
by hota_mazi 3y ago
Go 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?
- javcasas 3y ago> Java (and preferably Kotlin) are a lot more serious about making sure your code is robust before it compiles. You are making great points for Rust, Ocaml and Haskell.
- kaba0 3y agoThere isn't all that many plus in their type systems that is not expressible in Java. OCaml and Haskell has Monads, sure. There is Scala for that on the JVM.
- javcasas 3y ago> There isn't all that many plus in their type systems that is not expressible in Java. Thanks to Turing, anything that is Turing-complete can duplicate any other thing that is Turing-complete. So, yes, you can do all of Haskell's types in Java. That is not a flex. The flex is doing them in a non-horrific way.
- kaba0 3y agoThe kind of Turing completeness certain type systems have is useless beside academic curiosity - look at the vavr library, that’s what I’m talking about. You can have plenty Haskell types without any hacks, except for Monads in Java.
- javcasas 3y ago> vavr - turns java™ upside down "turn X upside down" are different words for "use X contrary to its original intention and design". You will find very few people willing to let go what people undestand as Java so as to be able to do Haskell-in-Java.
- kaba0 3y agoIt’s goddamn immutable collections and Optionals, not brain surgery come on. It’s not like Java hasn’t been going in the same direction, see records, sum types, pattern matching.