Q
Problem solve Get help with specific problems with your technologies, process and projects.

How do you feel about single exit points?

I've heard people argue for and against single exit points. The biggest complaint seems to be that they rely on GoTos. How do you feel about single exit points?
Personally, I SWEAR by them. I've seen the benefits of using them, and I think this is one case where GoTos contribute to the development process. It seems, however, that for every coding standard there are those that love it and those that hate it. The thing I try to preach most is choose a side and be consistent. If you haven't tried using single exit points, I highly suggest you consider them. They make the code easier to debug, and they have a tendency to help reduce coding errors by ensuring that clean-up code always executes before a procedure is finished.

For some people, the use of GoTo just jams them up and they can't focus on anything else. However, if you can realize that that there are uses for almost every language feature, you may come to think of GoTos as being a help and not a hindrance when it comes to the benefits of single exit points.

This was last published in February 2001

Dig Deeper on .NET development community

Have a question for an expert?

Please add a title for your question

Get answers from a TechTarget expert on whatever's puzzling you.

You will be able to add details on the next page.

Start the conversation

Send me notifications when other members comment.

By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Please create a username to comment.

-ADS BY GOOGLE

SearchCloudComputing

SearchSoftwareQuality

TheServerSide.com

SearchCloudApplications

Close