News for hackers. Stuff that matters.
Re:My takeaways from "Clean Code" by spc476 on Wednesday May 29, 2013 @12:41AM (#5784624)
Don't pass NULL (but do collect $200).

For modules I write in C, I only have one function that can return NULL---the function that creates a new structure. All other functions that work with that structure assume (backed by an assert()) that the passed in pointer will not be NULL. For the code I write, there is no reason for functions to accept a NULL pointer. And it's less painful that it sounds. I got the idea from _Writing Solid Code_, one of only two books that fundamentally changed how I write code (the other being _Thinking Forth_).

There are no comments on this comment yet.