3 ms·
I don't think having nullables can be called a feature as such. It adds complexity to your code and it directly goes against Go's philosophy of explicit error h
by Quothling 2y ago
I don't think having nullables can be called a feature as such. It adds complexity to your code and it directly goes against Go's philosophy of explicit error handling and simple types. Of course it's completely opinion based but I think having people handle errors directly instead of dealing with them through exceptions and checks makes for much more predictable code. I'm also not sure I really see the difference that GP does. I think that in a lot of code you're going to do a lot of null checks anyway, maybe even more than how often you'll check if your pointers are nil, but at least with Go you're not risking missing one.
Maybe the Go engineers didn't think about nullables, but I think there is a good chance they simply decided against them for various reasons.
- moomin 2y agoWe could argue about the Go philosophy till the cows come home, but maybe it would be better to just consider that not having a nullable int makes modelling database tables painful.