I wrote an article a while back for TechTarget / SearchWinDevelopment about static methods being a code smell.  It got published a few weeks ago and here’s a link to read it.

Static methods are a code smell
by Ben Day
02.26.2010

Ever heard of code smells? A code “smell” is a way of saying that there is potentially a problem with your code. It doesn’t mean that you’ve definitely made a mistake or that you’re definitely wrong for doing something wrong, it just means that you *might* be doing something wrong. At the moment, Wikipedia says that it is “any symptom in the source code of a program that possibly indicates a deeper problem.”

One of the common smells that I come across is static method and variables. (In VB.NET these are known as “Shared” methods.) If you mark a method as static, this means that the method now belongs to the type rather than an instance.

(read the article)

-Ben

One Response to Article: “Static methods are a code smell”

  1. thomas sabo says:

    thomas sabo on sale,best thoma sabo jewellery uk store,http://www.thomasabos.uk.com/
    thxs

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>