2 ms·
My experience writing Go is that nil pointer expectations are really not that big of a problem in practice. Linters and unit tests are quite good at catching th
by dgellow 6y ago
My experience writing Go is that nil pointer expectations are really not that big of a problem in practice. Linters and unit tests are quite good at catching those.
- stouset 6y agoOne can say that about literally any language with nil/null, and it's been empirically demonstrated beyond reasonable doubt at this point. The reality is that you don't know where your nil-dereference bugs exist because your language doesn't detect and force you to eliminate them.
- dgellow 6y agoA nil-dereference is very easy to spot in production: you have a panic and a stack trace in your logs. Which means you can check after a few years how many nil-pointer exceptions you got in your actual system. In my experience that numbers is really low.
- yawaramin 6y ago> very easy to spot in production: you have a panic and a stack trace in your logs. Not a great experience for your users though. And definitely not great for developers who get paged to handle these production incidents that could have been caught at compile time.
- baby 6y agoMy experience is that any Golang codebase that makes use of protobuf ends up having DoS vulnerabilities (because they forget to check for nil somewhere).