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.
By submitting your personal information, you agree that TechTarget and its partners may contact you regarding relevant content, products and special offers.
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.
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.