Hacker News new | past | comments | ask | show | jobs | submit login

Once you accept that the golang type system can't enforce everything your life will be easier.

Use rust or Haskell if you want a powerful type system that can do fancy things.

golang is great, but you have to accept that some things are runtime errors, and that's fine, it keeps things simple. How often are options given conditionally anyways? Simple tests will cover this in most cases.




No languages are perfect. Yes Go type system can't enforce everything, but it enforce many things. And Go is still language in evolving.


My point was that complex type systems also have down sides. Even if you strongly favor algebratic type systems, you have to admit they are harder to learn (at-least initially).

The upside with golang is that it's simple and easy to adopt; tiny learning curve, and code + APIs are intended to be simple.

If you are messing around with complex patterns in golang to get more compile-time correctness checks, you are most likely not keeping it simple. And thus, have missed the most important upside to golang.


These are all true things about any language on earth, except perhaps the evolving part.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: