topbanner_forum
  *

avatar image

Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
  • Friday December 13, 2024, 7:50 am
  • Proudly celebrating 15+ years online.
  • Donate now to become a lifetime supporting member of the site and get a non-expiring license key for all of our programs.
  • donate

Author Topic: A Bonehead Programming "Bug"  (Read 5770 times)

Renegade

  • Charter Member
  • Joined in 2005
  • ***
  • Posts: 13,291
  • Tell me something you don't know...
    • View Profile
    • Renegade Minds
    • Donate to Member
A Bonehead Programming "Bug"
« on: September 20, 2012, 03:49 AM »
Ok, this is something that I have done twice (second time being just now), and it's really quite funny, though totally boneheaded...

So, I'm programming away and trying to get the code in this one method to work, and nothing seems to be working. I fart around doing this and that and still nothing works. 15 minutes or so go by and then it dawns on me...

Bug fix...
You've got to call the method first! :P


Anyways, thought that might be a bit entertaining for a few here. (Am I the only one to have done this?)
Slow Down Music - Where I commit thought crimes...

Freedom is the right to be wrong, not the right to do wrong. - John Diefenbaker

Ath

  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 3,629
    • View Profile
    • Donate to Member
Re: A Bonehead Programming "Bug"
« Reply #1 on: September 20, 2012, 04:05 AM »
 :P Need more coffee (or other stimulants) ?

Renegade

  • Charter Member
  • Joined in 2005
  • ***
  • Posts: 13,291
  • Tell me something you don't know...
    • View Profile
    • Renegade Minds
    • Donate to Member
Re: A Bonehead Programming "Bug"
« Reply #2 on: September 20, 2012, 05:27 AM »
:P Need more coffee (or other stimulants) ?

Coffee is my stimulant of choice! Turkish fine double with milk and honey. :)
Slow Down Music - Where I commit thought crimes...

Freedom is the right to be wrong, not the right to do wrong. - John Diefenbaker

Stoic Joker

  • Honorary Member
  • Joined in 2008
  • **
  • Posts: 6,649
    • View Profile
    • Donate to Member
Re: A Bonehead Programming "Bug"
« Reply #3 on: September 20, 2012, 07:01 AM »
Anyways, thought that might be a bit entertaining for a few here. (Am I the only one to have done this?)

I can attest to there being at least two of us guilty of that. :)

Deozaan

  • Charter Member
  • Joined in 2006
  • ***
  • Points: 1
  • Posts: 9,778
    • View Profile
    • Read more about this member.
    • Donate to Member
Re: A Bonehead Programming "Bug"
« Reply #4 on: September 20, 2012, 01:30 PM »
I've done it.

I just barely complete putting the finishing touches on a new function/method I've created and then I go to test it out and... nothing happens? :huh:

Oh yeah! Gotta put in a call to the function/method first! :-[

wraith808

  • Supporting Member
  • Joined in 2006
  • **
  • default avatar
  • Posts: 11,190
    • View Profile
    • Donate to Member
Re: A Bonehead Programming "Bug"
« Reply #5 on: September 20, 2012, 03:43 PM »
I had a similar problem recently that I spent half the day on  :-[

In one particular case, the data wasn't rendering.  I called over someone to look at it with me, and she pointed out that in the case where it wasn't rendering, I wasn't returning a value, just null.  D'oh!

And on that subject... I saw this piece of code:

Code: C# [Select]
  1. private void Execute()
  2. {
  3.     if (InvokeRequired)
  4.     {
  5.         lock (new object())
  6.         {
  7.             if (m_instance != null)
  8.                 Invoke(new threadDelegate(Execute), new object[] { });
  9.         }
  10.     }
  11.     else
  12.     {
  13.         if(OnInstanceChanged != null)
  14.             OnInstanceChanged();
  15.     }
  16. }

WTF?!?

kyrathaba

  • N.A.N.Y. Organizer
  • Honorary Member
  • Joined in 2006
  • **
  • Posts: 3,200
    • View Profile
    • Donate to Member
Re: A Bonehead Programming "Bug"
« Reply #6 on: September 20, 2012, 07:27 PM »
@OP: Heh, you've only done that twice? I'm sure I've done it several times  :P

Renegade

  • Charter Member
  • Joined in 2005
  • ***
  • Posts: 13,291
  • Tell me something you don't know...
    • View Profile
    • Renegade Minds
    • Donate to Member
Re: A Bonehead Programming "Bug"
« Reply #7 on: September 20, 2012, 07:59 PM »
@OP: Heh, you've only done that twice? I'm sure I've done it several times  :P

Actually, I only *remember* doing it once before, and the other time I spent, well, lets just say more than 15 minutes.  :-[
Slow Down Music - Where I commit thought crimes...

Freedom is the right to be wrong, not the right to do wrong. - John Diefenbaker

jgpaiva

  • Global Moderator
  • Joined in 2006
  • *****
  • Posts: 4,727
    • View Profile
    • Donate to Member
Re: A Bonehead Programming "Bug"
« Reply #8 on: September 21, 2012, 05:39 AM »
It's even funnier when you forget to start a thread in a multi-threaded program. Just happened to me. Twice :P