Boni opened this issue on Jan 12, 2016 ยท 101 posts
bagginsbill posted Wed, 13 January 2016 at 7:19 AM
Yesterday I was asked to fix a bug. One of the other programmers I work with had modified a piece of Javascript to detect a special status code, 498, that we use to tell clients the authentication token had expired or was otherwise no longer valid.
He insisted he DID check for it. And yet it was not working. He distinctly remembered adding the check. But it was not doing what he thought he told it to do. Here's the code.
if (xhr.status == 401 || response.status == 498) { oops("Error: Please log in again");
The problem here is the programmer thinks he knows what he said. But he said "response.status", which happens to exist, but is not where the 498 is. It should have said
if (xhr.status == 401 || xhr.status == 498)
This subtle difference between mental model and actual program is largely the cause of such failures. I say this to you not to say this is actually happening, but if the "programmer" believes he knows what is happening, and this belief is factually inaccurate, you can't tell. His conviction that he knows what is happening is unshakeable.
If the "programmer" here thinks there is no problem, he needs to get somebody else to review the code, as I did for my colleague.
Renderosity forum reply notifications are wonky. If I read a follow-up in a thread, but I don't myself reply, then notifications no longer happen AT ALL on that thread. So if I seem to be ignoring a question, that's why. (Updated September 23, 2019)