Good news, bad news

Started by
5 comments, last by chollida1 17 years, 11 months ago
The good news is, I found out how to double my data sample. The bad news is, I do this by fixing a bug in my code. The lesson is, if you insist on having a local variable mask a member variable, make sure your compiler warnings are set to tell you that you are being an idiot!
To win one hundred victories in one hundred battles is not the acme of skill. To subdue the enemy without fighting is the acme of skill.
Advertisement
Yay for compiler warnings!
Yeah, if the compiler would warn you in other situations as well

A few minutes ago I finished my 1000ths ray triangle intersection implementation.
I tested for an hour until I got sick of the code I wrote, rewrote everything to finally realize that I have been testing a ray against a triangle parallel to that ray *ugh*
http://www.8ung.at/basiror/theironcross.html
Quote:Original post by King of Men
The good news is, I found out how to double my data sample.
The bad news is, I do this by fixing a bug in my code.
The lesson is, if you insist on having a local variable mask a member variable, make sure your compiler warnings are set to tell you that you are being an idiot!


I don't see how this is bad news? I see it as killing two birds with one stone.
It's bad news because that bug has been around for several months, messing up my plots and conclusions. I found it in the writing-up-results stage, which is highly embarrassing.
To win one hundred victories in one hundred battles is not the acme of skill. To subdue the enemy without fighting is the acme of skill.
With Visual Assist X you can highlight your global and local variables specially.

I know why my source code looks like a rainbow =)
you could also just adopt a naming convetion for local and global variables. Its not uncommon to see Global variables appending _G on their end or beginning to signify they're global.

<insert obligatory remark about how some people really like hungarian notation and some really don't>

Cheers
Chris
CheersChris

This topic is closed to new replies.

Advertisement