[PRL] Joel on Software - Making Wrong Code Look Wrong

Doug Orleans dougo at place.org
Wed May 11 17:03:28 EDT 2005


Mitchell Wand writes:
 > And of course the last part, the Rant Against Exceptions is also a Rant 
 > Against Advice.

I don't think this is true (although I wouldn't be surprised if he had
a different Rant Against Advice).  The gist of his Rant Against
Exceptions seems to be (translated to Scheme) that the expression
"(begin (foo) (bar))" may not always result in "bar" being called.
This is actually a Rant Against Continuations ("foo" might not return
because it invoked a continuation), and perhaps a Rant Against Macros
("begin" might be a macro that ignores its second argument).  But with
(AspectJ-style) advice, there's no way to prevent "bar" from being
called (other than, well, throwing an exception in the advice for
"foo").  You can intercept the call to "bar" and do something before
or instead of executing the code for "bar", but you can't actually
prevent the call from happening (in the way that he's ranting about,
where "foo" never returns).

--Doug



More information about the PRL mailing list