Sign in to follow this  
King of Men

Good news, bad news

Recommended Posts

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!

Share this post


Link to post
Share on other sites
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*

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
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.

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
With Visual Assist X you can highlight your global and local variables specially.

I know why my source code looks like a rainbow =)

Share this post


Link to post
Share on other sites
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

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this