• We’re currently investigating an issue related to the forum theme and styling that is impacting page layout and visual formatting. The problem has been identified, and we are actively working on a resolution. There is no impact to user data or functionality, this is strictly a front-end display issue. We’ll post an update once the fix has been deployed. Thanks for your patience while we get this sorted.

Stupidest programing mistake?

I spent more time then I'm willing to admit trying to track down why my C++ program was dying when the error condition wasn't met:

 
Originally posted by: Armitage
I spent more time then I'm willing to admit trying to track down why my C++ program was dying when the error condition wasn't met:

Darn hidden braces

 
Originally posted by: Armitage
I spent more time then I'm willing to admit trying to track down why my C++ program was dying when the error condition wasn't met:

This is why I'm a bracket whore. It may work without them, but its only 2 extra characters and can save headaches later. Its worth it to me.
 
Originally posted by: Kilrsat
Originally posted by: Armitage
I spent more time then I'm willing to admit trying to track down why my C++ program was dying when the error condition wasn't met:

This is why I'm a bracket whore. It may work without them, but its only 2 extra characters and can save headaches later. Its worth it to me.

I ussually am ... brackets whether you need em or not. But combine several months away from C++ and alot of python work, and the indented code looked just fine!

In case you're not a python guy ... python uses level of indention to determine scope.
 
Originally posted by: Armitage
Originally posted by: Kilrsat
Originally posted by: Armitage
I spent more time then I'm willing to admit trying to track down why my C++ program was dying when the error condition wasn't met:

This is why I'm a bracket whore. It may work without them, but its only 2 extra characters and can save headaches later. Its worth it to me.

I ussually am ... brackets whether you need em or not. But combine several months away from C++ and alot of python work, and the indented code looked just fine!

In case you're not a python guy ... python uses level of indention to determine scope.
Yeah, I know, screwy python 😉

I've run into a few interesting situations when switching from doing work and my hobby code. After staring at VB.net code for a long enough time, the brain just turns off thinking about structure (all of the auto-complete stuff in Visual Studio doesn't help either). If I'm tired enough I start writing code like:

String something As New String
if (blah > blah2
blah.inde"ui"
...


Nothing like a mixture of multiple languages and incomplete statements to make you go "Doh!" when you try to compile without previewing.
 
Back
Top