Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

You're not being very precise about your exact issues. `nil` isn't anywhere as much of an issue in Go as it is in Java because not everything is a reference to an object. A struct cannot be nil, etc. In Java you can literally just `return null` instead of an `Optional<T>`, not so in Go.

There aren't many possibilities for nil errors in Go once you eliminate the self-harm of abusing pointers to represent optionality.



Pointers are pretty common in Go though. Not as common as Java, granted—you're not NPEing on an integer—but they still get passed around a decent amount.




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

Search: