3 ms·
> When code and comments disagree, both are probably wrong. Here it's worse-- there is a single source of truth copy-pasted into two different parts of the mes
by jancsika 6y ago
> When code and comments disagree,
both are probably wrong.
Here it's worse-- there is a single source of truth copy-pasted into two different parts of the message, apparently synchronized by forcing a human to remember to do some work to synchronize the data.
Even worse, the implicit OR in displaying the data essentially guarantees that even someone trying to synchronize the data must go to the trouble of viewing both the HTML and the plain text to make sure it's correct.
And perhaps to a layperson, "plain text" means "I checked a test message in gmail, there were no images in the message, so I guess I just verified the plain text is correct."
This reminds me when I was documenting how an over-engineered UI widget works, and I suddenly noticed there were two member fields far apart from each other in the struct:
1. int x_changed
2. int x_change
Sedimentary Programming ftw! :)