Sunday, February 11, 2007

What it is isn't always what you expect

An article from the great Eric Lippert on how finally blocks are called after exception filters, meaning that they execute before any state fixing up that you might be doing in your finally block. Most people find the behaviour bizarre, but as one commentator put it, it is a finally block, not an immediately block.

I believe there is a connection to the spiritual life here, though it may be silly. What I mean to say is that things are often extremely nonintuitive , and the most 'obvious' things are sometimes the most false when it comes to human relationships and the workings of out own minds.

Moral of the story? In a secure context, catch exceptions instead of relying on finally blocks. Also, put brain in gear before engaging mouth.

Labels: ,


Comments: Post a Comment

<< Home

This page is powered by Blogger. Isn't yours?