in

Ative at Work

Agile software development

Ative at Work

Ugly Code - Exception Handling Anti-Pattern

A message of despair from a consultant friend:

I am working on a project and we have to deliver "the complete product" in 1 1/2 weeks. This morning i stumbled on this "Pattern" two places in one of our applications (WinApp) - now I am too afraid to look at the rest of the code base:

catch(System.Exception ex)
{
    Console.WriteLine(ex.Message);
}

..... sigh

Published okt 03 2006, 04:33 by Martin Jul
Filed under: ,

Comments

 

Søren Lindstrøm said:

Actually there is a bonus anti-pattern in that statement. Why write System.Exception? Either you are using explicit class-paths. OR you have created your own System-namespace (i.e. using a subfolder in your project).

Whether you fancy obscuring your code with endless namespace-referencing or creating redundant namespaces, you should consider a different career that software developer... How about full-time Quake gamer?  

oktober 9, 2006 11:39

About Martin Jul

Building better software faster is Martin's mission. He is a partner in Ative, and helps development teams implement lean/agile software development and improve their craftmanship teaching hands-on development practises such as iterative design and test-first. He is known to be a hardliner on quality and likes to get things done-done.
© Ative Consulting ApS