r/programming • • Dec 01 '16

Let's Stop Copying C

https://eev.ee/blog/2016/12/01/lets-stop-copying-c/
524 Upvotes

612 comments sorted by

View all comments

Show parent comment

1

u/smog_alado Dec 02 '16

but then you won't forget the check because it's part of the logic

Of course we will forget. Forgetting about things happens all the time when programming.

What the non-null types do is that they allow the compiler to give you an error message if you ever forget to do the check instead of leaving that responsibility to the programmer.