Comment by networkadmin
10 hours ago
You're completely wrong. The fact that people are still talking about it today proves it has some kind of worth. The essay was great.
10 hours ago
You're completely wrong. The fact that people are still talking about it today proves it has some kind of worth. The essay was great.
People are still talking about a flat Earth and creationism. Given 8 billion people, there are enough available braincells to keep even the stupidest idea floating around in the memesphere.
People are still talking about null pointers: that doesn't mean they were ever a good idea.
That's just how the hardware works. Don't like it? Make your own CPU.
So the case that you're making here is that CATB is renowned amongst the kind of practitioners who think NULL pointers are "just how the hardware works". Sounds about right.
6 replies →
No, the CPU doesn't have a special pointer value which is designated invalid (except as far as modern address spaces are so large that you cannot possibly map memory to each address without mirroring). In many OSs, e.g. CP/M, address 0 is actually meaningful. The C idiom of cramming sum-type semantics into the nooks and crannies of a return value that ordinarily means something entirely different is an extremely poor one, and null pointers are the poster child: Tony Hoare's billion-dollar mistake.
It's absolutely fine to have a packed representation of a sum type "under the hood": this is how Rust implements Option<&T> (where T: Thin), for example. It's also fine to expose the layout of this packed representation to the programmer, as C's union does. But it's a huge footgun to have unchecked casts as the default. If not for this terrible convention, C wouldn't have any unchecked implicit casts: something like f(1 + 0.5) performs a coercion, a far more sensible behaviour.
The only reason we're talking about null pointers at all is because they were an influential idea, not because they were a good idea. Likewise with the essay.
5 replies →
They aren't there in asm.
1 reply →
There are lots of proven bad ideas still being bandies about today, and it does not prove they are anything but enduringly worthless.