Become a member

Get the best offers and updates relating to Liberty Case News.

― Advertisement ―

spot_img

My favorite October reads – The Bloggess

Someone recently told me that the reason I have so much anxiety is because I read so many dark, horror books and I explained...
HomeFunnyBrace Yourself - The Daily WTF

Brace Yourself – The Daily WTF

Today’s representative line is almost too short to be a full line. But I haven’t got a category for representative characters, so we’ll roll with it. First, though, we need the setup.

Brody inherited a massive project for a government organization. It was the kind of code base that had thousands of lines per file, and frequently thousands of lines per function. Almost none of those lines were comments. Almost.

In the middle of one of the shorter functions (closer to 500 lines), Brody found this:


This was the only comment in the entire file. And it’s a beautiful one, because it tells us so much. Specifically, it tells us the developer responsible messed up the brace count (because clearly a long function has loads of braces in it), and discovered their code didn’t compile. So they went around commenting out extra braces until they found the offender. Code compiled, and voila- on to the next bug, leaving the comment behind.

Now, I don’t know for certain that’s why a single closing brace is commented out. But also, I know for certain that’s what happened, because I’ve seen developers do exactly that.

Source link