Code Smells

Code Smells / Dispensables / Dead Code

Dead Code code smell icon

Dead Code

A Dead Code smell occurs when code is not used, be it a variable, method, class, or parameter.

This code smell is often created when code has become obsolete, and so is not instantiated, called, initialised, etc.

The offending code causes codebase clutter, and may cause confusion later on in development, slowing development.

To fix this code smell, such code should be deleted. Offending code can be easily found using most IDEs.

Left chevron Right chevron

Books about code smells

Learn to write better smelling code.

Refactoring: Improving the Design of Existing Code book cover

Refactoring: Improving the Design of Existing Code

Code smells: A Predictor of Remarkable Quality Improvement book cover

Code smells: A Predictor of Remarkable Quality Improvement

Clean Code: A Handbook of Agile Software Craftsmanship book cover

Clean Code: A Handbook of Agile Software Craftsmanship

I receive a commission on sales made from the above affiliate links.