One More Recipe Against NULL [Snippets]

You know what NULL is, right? It's evil. In OOP, your method can return NULL, it can accept NULL as an argument, your object can encapsulate it as an attribute, or you can assign it to a variable. All four scenarios are bad for the maintainability of your code—there are no doubts about that. The question is what to do instead. Let's discuss the "return it" part and I will suggest one more "best practice" on top of what was discussed a few years ago.

Look at this code:

What feeling does this article give you?

#hashtags to follow:

NULL [+]    OOP [+]   

More #news: