Click here to Skip to main content
15,895,084 members
Articles / Programming Languages / C#

The goto-less goto!

Rate me:
Please Sign up or sign in to vote.
4.00/5 (4 votes)
7 Feb 2011CPOL 10K   2  
Usually, gotos are used to clean up resources when exiting a function. I would recommend using the RAII[^] idiom. It also works works well in the presence of exceptions.For C# I would use IDisposable/using. If that's not possible, I'd use a finally clause to clean up.Everything else...

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)
Sweden Sweden
I make software.

Comments and Discussions