Skip to content

Wrappers that only forward; barrel files that only re-export ​

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

What makes wrappers that only forward and barrel files that only re-export a bad practice? ​

The standards that call it a bad practice: Fowler: Middle Man, Lazy Element; Ousterhout: Pass-Through Method, Shallow Module; Vite performance guide: avoid barrel files.

What does lessloc do about wrappers that only forward and barrel files that only re-export? ​

lessloc catches it as wrapper.

  • wrapper (tier 2): A function that only forwards to another, or a file that only re-exports.

The other patterns in Code nobody needs:

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