Skip to content

An interface, trait, protocol or abstract class with one implementation ​

Code nobody needs: one of the ways AI coding agents bloat software, from lessloc's pattern catalog. lessloc catches it as single-impl.

What makes an interface or abstract class with one implementation a bad practice? ​

The standards that call it a bad practice: Fowler: Speculative Generality (Collapse Hierarchy); Ousterhout, A Philosophy of Software Design: classitis.

What does lessloc do about an interface or abstract class with one implementation? ​

lessloc catches it as single-impl.

  • single-impl (tier 2): An interface or abstract class with one implementation, or an abstract class with none.

The other patterns in Code nobody needs:

Released under the Apache-2.0 license. · llms.txt