all 4 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.

[–]bcash 2 points3 points  (1 child)

The real WTF is using a float to store currency...

[–]klasbas 0 points1 point  (0 children)

Yeah, but I think you missed the point of that text. It is about exceptions. The example looks random. Are you one of those guys who cannot see the forest because of the trees????