In Python: Why Over-Abstraction in Clean Code Hurts Cohesion and How to Fix It Using Data Classes
Clean code in software design means maximizing cohesion by grouping elements that change for the same reason and drawing boundaries only where they clarify behavior, rather than maximizing smallness or applying abstraction, patterns and decomposition by checklist. Over-decomposition, such as indirection layers that solve no problem while complex logic remains in one place, yields designs that look tidy but are hard to change; the remedy is to make the data flow (a pipeline of load, transform, export) explicit and controllable by the caller, to group related settings into immutable configuration objects (data classes with sensible defaults), to place behavior with the data it belongs to, and to separate pure business rules into dedicated functions. This belongs to object-oriented and functional software design principles (cohesion, single reason to change, separation of concerns, visibility of intent) and is illustrated in Python.