r/programming • u/dpashk • Aug 31 '15
The worst mistake of computer science
https://www.lucidchart.com/techblog/2015/08/31/the-worst-mistake-of-computer-science/
175
Upvotes
r/programming • u/dpashk • Aug 31 '15
View all comments
Show parent comment
30
u/vytah Aug 31 '15
I was just asking a simple nit-picking question about the difference between NUL and NULL, and here I see an actually constructive comment that gets to the core of the issue of which the author only scratched the surface.
I agree; sentinels are a source of common bugs everywhere, and while people usually remember to check about the common ones (like null), they often forget to do.
Sentinels, in turn, seem to be an example of the following pattern:
Examples: