Notes on "Elegant Objects (Volume 1)" - continued

Starting Chapter - 4!

Never Return null

Alternatives suggested in the book are not really better than null, in my opinion. Like returning an empty List of Employees from a method named getEmployee(long id).. Just return null, if no such Employee exists, I would say.. Using Null Object Pattern is.. I do not know..

Fail Fast vs Fail Safe

Fail Safe basically motivates us to do as much as possible to keep the software running, even when we hit a bug, an input / output problem, a memory overflow, etc..
Fail Fast is the opposite approach. It motivates us to stop execution and throw an exception as soon as we see a problem - any problem. 
We should make our software as fragile as possible and then cover it with unit tests. We emphasize instead of hiding. We make them visible and easy to trace. We don 't want to face the fact that our software has bugs, and that is a trap! It is full of bugs. Some of them are obvious and visible while others are properly hidden.
Wise words from a wise man..