Re:Updating the Go Memory Model
by voidnullnil on Monday July 12, 2021 @03:39PM
(#27814130)
I've never bothered to look up the hoare thing, but null as a member of all types increases the amount of time spent studying any given API (and of course, there are lots of null pointer bugs from people who didn't bother to study the API sufficiently).
Re:Updating the Go Memory Model
by throwaway894345 on Monday July 12, 2021 @04:55PM
(#27815019)
Yeah, as previously mentioned, I fully agree that nullable pointers kind of suck and exhaustive pattern matching on enums is strictly better. I'm taking issue narrowly with abusing the "billion dollar mistake" quote to exaggerate the severity of the problem.
Re:Updating the Go Memory Model
by voidnullnil on Monday July 12, 2021 @05:12PM
(#27815198)
It's a big problem in Java at least. In Go you have value types by default and they try to make zero a meaningful value.
Re:Updating the Go Memory Model
by throwaway894345 on Monday July 12, 2021 @05:20PM
(#27815274)
It's not a big problem when you look at the problems that plague even the most popular programming languages. At this point I can only refer you to my previous posts because I'm repeating myself. :)
Which problems do Java and C# have that golang doesn't? Incidentally, both of them have solutions to the billion dollar mistake, which golang doesn't.
I get the distinct impression that people who invoke this boilerplate Hoare quote argument don't understand that null pointer bugs are "a billion dollar mistake" because nullable pointers have been idiomatic in every major programming language for the last 40+ years, not because they are individually particularly expensive.
Yeah, Rust-like enums would probably be strictly better than null pointers, but people talk about null pointers like they are going to doom your project when in reality they're mere papercuts--a small subset of all type errors--and there are whole projects that are written in fully dynamically typed languages! Indeed, there are worse problems than type errors in a language--you could have an impoverished ecosystem, poor tools (especially build tools), or abysmal performance, and many of the most popular programming languages have two of the three and null pointers. Go is fortunate to have only null pointers (papercuts) working against it.