News for hackers. Stuff that matters.
Re:Isaacs: try/catch is an anti-pattern by epenn on Monday November 14, 2011 @08:22AM (#3233833)
try/catch, which blurs the line between errors that are mistakes (accessing a property of null, calling .write() on a stream after .end(), etc.), and those which are expected application-level problems (invalid data, file missing, and so on).

While I tend not to be a big fan of try/catch myself, one thing I like about Objective C and Cocoa is that they at least provide classes to separate programmer mistakes (NSException, used with try/catch) from application issues (NSError, used however it best fits the app). If the try/catch pattern must be used, I think its sensible to have this kind of separation of responsibilities.

There are no comments on this comment yet.