Even very senior engineers can make simple mistakes that can bruise their egos. Several years ago I was called into the office of the chief architect. I was also a senior engineer with a lot of experience, but he was quite famous (at the time) in the industry for his technical skill. He was convinced he had found a compiler bug. He had some c code that he had traced through the debugger at the assembly level. It was something like this:
if(/some really long boolean value with AND and OR clauses/);
{
/* some code to execute if TRUE */
}
He was sure that the if statement was FALSE some of the time, but the code inside the brackets would always execute. He spent more than an hour pouring over the code.
It took me a few minutes before I noticed the semicolon at the end of the if statement. I'm sure he felt stupid when I pointed it out.
if(/some really long boolean value with AND and OR clauses/); { /* some code to execute if TRUE */ }
He was sure that the if statement was FALSE some of the time, but the code inside the brackets would always execute. He spent more than an hour pouring over the code.
It took me a few minutes before I noticed the semicolon at the end of the if statement. I'm sure he felt stupid when I pointed it out.