Code Smell: Code comments
This post argues that frequent or explanatory comments often indicate overly complex implementation. Instead of relying on comments, developers should simplify structure, clarify intent through naming, and break down complex logic. It also outlines when comments remain appropriate and valuable.
Code Smell: Primitive Obsession
This post explains how overusing primitive data types to model domain concepts can weaken structure and create hidden complexity. It outlines strategies to replace grouped data with dedicated objects, strengthen typing, and reduce repetition. Refactoring in this way improves clarity, keeps related behavior together, and makes the system easier to maintain.
Code Smell: Switch Statements
This post explores how scattered and duplicated conditional logic increases maintenance effort and risk when requirements change. It shows how reorganizing behavior around dedicated types reduces repetition and makes introducing new variations more straightforward. The result is a design that is easier to extend without repeatedly modifying existing logic.
Code Smell: Long method
This post explores why long methods reduce readability and make understanding code harder. It outlines strategies for breaking large methods into smaller, self-explanatory units, including extracting methods, using parameter objects, and decomposing conditionals. Refactoring in this way improves clarity, maintainability, and can uncover hidden duplication.
Code Smell: Long Parameter List
This post explores how methods with many parameters can reduce readability and increase confusion. It outlines practical strategies to simplify calls, such as grouping related data or replacing parameters with explicit methods. Refactoring in this way improves clarity and can also reveal hidden duplication.