The Daily WTF
Follow
CodeSOD: The John Cage Variable
David C, who writes C++ code for programmatic animations, confessed to writing code without prioritizing quality due to its disposable nature. However, a particular line of code made him question his approach. The line featured heavily array-based parameter passing, leading to unintelligible variable names. For instance, length4_3_3, seemingly an attempt at a variable, is described as a range expression of size one. This naming convention fails to convey the meaning of the data it holds. While the code was intended to be temporary, David acknowledges that code is rarely truly disposable. He reflects on the tendency to reuse code across projects. The author suggests that even disposable code can have lasting implications. Ultimately, he advises readers to strive for better code quality.