The Daily WTFRemy Porter1 min readintro
CodeSOD: The John Cage Variable
Summary
This article showcases a C++ code snippet with an extremely unreadable variable name, `length4_3_3`, which is a hardcoded range expression. It serves as a cautionary tale against writing "disposable" code with poor naming conventions, as such code often ends up being reused.
- Even "write-and-run-once" code often gets pulled into future projects, making initial quality important.
- Packing parameters into arrays and using indices instead of named variables leads to unreadable code.
- Variable names should describe content, not how to derive it, like `length4_3_3` which is an expression.
- Poor naming conventions severely hinder code comprehension and maintainability.
This piece is a reminder for all engineers that even seemingly disposable code benefits from good practices, as shortcuts often lead to future technical debt.
4/10