Click here to Skip to main content
15,887,746 members
Articles / Programming Languages / C# 4.0

Try - finally alternative

Rate me:
Please Sign up or sign in to vote.
5.00/5 (5 votes)
5 Jun 2011CPOL 8.3K   2  
Not really, because what if your finally block would contain more lines of code than the single line you have in your example? That would make it already much harder to read.Secondly, you are misusing the Dispose method. You shouldn't invoke anything in it, especially not the Action, you...

Views

Daily Counts

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Software Developer (Senior)
Netherlands Netherlands
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.

Comments and Discussions