Code never lies, comments sometimes do
Meaning
The executable code of a program inherently reflects its true functionality, whereas human-written comments, despite their purpose, can become outdated, inaccurate, or misleading over time.
Origin
In the wild, complex world of software engineering, where programs grow into sprawling digital cities, a harsh truth emerged: while code itself is an undeniable, logical truth, the human-written explanations beside it – the comments – are fallible. As systems were built and modified over decades, developers learned that comments, though well-intentioned, often became outdated or even outright misleading as the code evolved beneath them. The machine would always execute exactly what the code commanded, but the human mind, reading an old comment, could be easily led astray. This stark contrast forged the maxim, 'Code never lies, comments sometimes do,' a stern reminder for programmers to always trust the cold, hard logic of the executable over the potentially deceiving whispers of human annotation.
Examples
- When debugging the legacy system, I found myself thinking, 'Code never lies, comments sometimes do' because the comments were completely out of sync with what the program was actually doing.
- The senior developer always emphasized that principle, reminding the junior team members that while comments are helpful, they should always trust the code itself, understanding that code never lies, comments sometimes do.