Azure DevOps, Scrum, & .NET Software Leadership and Consulting Services

Free course! Predicting the Future, Estimating, and Running Your Projects with Flow Metrics

Article: “Static methods are a code smell”


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

SUBSCRIBE TO THE BLOG


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

  1. thomas sabo Avatar

    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 *

This site uses Akismet to reduce spam. Learn how your comment data is processed.