Skip to content

Obsolete code kept behind a guard or flag instead of deleted ​

Code nobody needs: one of the ways AI coding agents bloat software, from lessloc's pattern catalog. lessloc gives every session the rule: delete what the change makes dead.

What makes obsolete code kept behind a guard or flag instead of deleted a bad practice? ​

The standards that call it a bad practice: CWE-561; Fowler: Remove Dead Code.

What does lessloc do about obsolete code kept behind a guard or flag instead of deleted? ​

lessloc gives every session the rule: delete what the change makes dead.

The other patterns in Code nobody needs:

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