Wednesday, April 06, 2005

Simpler Main in .NET

Wintellect has an interesting article advocating a simpler main block in your applications. Their main point is that you do not want an unhandled exception to be raised in your main block because you will have no other place to catch it. Basically your main should only have an try / catch block with a call to another method from the same class and a call to an exception handler in the same class. The importance of having them in the same class is it doesn't require loading other types / assemblies. They have some interesting points, but as usual with any proposed best practices there are as many arguments against as for it.

No comments: