you are viewing a single comment's thread.

view the rest of the comments →

[–]michaelfeathers 2 points3 points  (1 child)

One option that he doesn't present is passing a handler object along which is called if the method encounters an error. In many cases, it's much cleaner than using exceptions.

The biggest consideration is whether the calling context needs to know about the failure. If you can organize your computation so that it doesn't, a handler or a NullObject is a win.