DEV Community

Cover image for Code Smell 18 — Static Functions
Maxi Contieri
Maxi Contieri

Posted on • Updated on • Originally published at maximilianocontieri.com

Code Smell 18 — Static Functions

Yet another global access coupled with laziness.

TL;DR: Don't use static functions. They are global and utilities. Talk to objects instead.

Problems

  • Coupling

  • Testability

  • Protocol Overloading

  • Cohesion

Solutions

Examples