While I think it's every software developers business to handle error
returns I think programming could be greatly simplified for many packages if
libraries had a "mode" where instead of returning null/error values the
program simply terminated (and the library defaulted to that mode).
Don't we have that already? If NULL is returned and this pointer
is dereferenced (what else would it be good for?) the program
exits.
The real problem is returning invalid but non-NULL pointers
since they often don't result in an immediate SIGSEGV...
Those were a NULL pointer are involved are he relatively
easy ones to find and fix bugs.
The whole article cited by the OP isn't more than a rant
by someone who can't tie a knot and thus hates shoes
with laces. All there is is a complaint that NULL pointers
exist but no ideas are proposed of how to eliminate them.
Trying to ride on some famous utterance by Dijkstra just
makes it look even more lame. And the real serious pro-
blem of stray pointers isn't even mentioned. Well, pro-
grammers not disciplined enough to deal with issues of
memory allocation probably shouldn't try to use a lan-
guage that does allow them to do so (while these more
"protective" languages in most cases are written in a
language like C that needs pointers to be able to write
a language interpreter/compiler that keep less disciplined
people from hurting themselves;-)
Fortran has this solved better than C: when I don't specify an
optional error return argument to several built-in routines the
run-time will simply abort then program on file errors etc.
That's not the Fortran I learned nearly 30 years ago;-) But this
sounds more like a standard library issue. But then also e.g.
strcpy() will abort the program if the source or destination
pointer is a NULL pointer, the real problem is bad, but non-NULL
pointers. And I have no idea how Fortran could detect them
reliably. But then my exposure to Fortran is rather outdated,
it was the first computer language I ever learned and I still
shudder when remembering things like "COMMON BLOCK" and what
atrocities could be (and in a lot of programs I've seen were)
done with it;-).
Regards, Jens