Are Static Methods/Variables bad practice?

Static methods and variables. Are they bad practice?

In short: Yes. There are many disadvantages and static methods should almost never be used.

Static methods allow procedural/functional code to be shoe-horned into an Object Oriented world. Using static methods and variables breaks a lot of the power available to Object-Oriented code.

Why are they used?

Before any analysis on the benefitis or problems of static methods, the question must be asked: “Why are static methods used?” Continue reading “Are Static Methods/Variables bad practice?”