Author Topic: Your most annoying coding mistake?  (Read 865 times)

Offline Tribal

  • Level 22
  • *
  • Posts: 256
  • Reputation: +1/-1
    • View Profile
Your most annoying coding mistake?
« on: November 08, 2008, 01:49:26 PM »
Has anyone else noticed how the smallest mistakes in code are usually the ones you stress over most?

Personally I have. Example of this: i removed a session variable that gets set and later in another page that variable gets checked. I forgot to remove the check and it caused me problems for hours. Lol. Noob!

Anyway, whats your most "Noobish" coding mistake?

Offline bbgames

  • Level 16
  • *
  • Posts: 138
  • Reputation: +1/-0
    • View Profile
    • Building Browsergames
Re: Your most annoying coding mistake?
« Reply #1 on: November 08, 2008, 01:54:35 PM »
The very first time I built an authentication system, I didn't really know much about using the session - so I just stored a cookie myself, in the form of username%hashed_password - and then split them after retrieving them. However, in my authentication checks I hashed the password a second time - meaning that the value in their cookie, while the right value, would never match the value in the database.

It took me much longer than I'd like to admit to find that bug.

Offline xBleuWolfx

  • Level 17
  • *
  • Posts: 158
  • Reputation: +3/-2
    • View Profile
Re: Your most annoying coding mistake?
« Reply #2 on: November 09, 2008, 01:34:49 AM »
I once built an authentication system that requires users to be logged in to view most of the page on the site. If a user wasn't logged in when they visited those pages, a script would force them to the log-in page to log in. I accidentally included the script into the log in page itself which caused the web browser to try to reach a page it couldn't access.
I'm not slacking off. My code's compiling.


Offline JGadrow

  • Level 35
  • **
  • Posts: 1,133
  • Reputation: +23/-2
    • View Profile
Re: Your most annoying coding mistake?
« Reply #3 on: November 10, 2008, 07:14:29 AM »
I really don't have a lot of stories. Usually my mistakes revolve around syntax errors rather than logic errors. However, when I was first learning PHP I was stumped for quite some time on the include path problem.

Since I began with C/C++, it was a completely foreign idea to me that including a file which included a file would cause the program to break.

**Note, the reason I'm able to avoid most logic errors is because I stub out my functionality first, thus allowing me to detect logic errors VERY early in the planning process. I highly recommend it!
Idiocy - Never underestimate the power of stupid people in large groups.


Offline Tribal

  • Level 22
  • *
  • Posts: 256
  • Reputation: +1/-1
    • View Profile
Re: Your most annoying coding mistake?
« Reply #4 on: November 11, 2008, 02:07:19 AM »
What do you mean by: "because I stub out my functionality first"?

Offline Scion

  • Level 27
  • **
  • Posts: 402
  • Reputation: +11/-0
    • View Profile
Re: Your most annoying coding mistake?
« Reply #5 on: November 11, 2008, 02:09:11 AM »
**Note, the reason I'm able to avoid most logic errors is because I stub out my functionality first, thus allowing me to detect logic errors VERY early in the planning process. I highly recommend it!

I recomend that all those new to development should read 'Code Complete' by Steve McConnel... Its an oldie but a goodie.....and unlike many Computer related books is just as relevant today as it was when first written.

Starting by writing pseudocode, which becomes your comments then filling in the blanks with your actual code is something that he recomends.

Offline JGadrow

  • Level 35
  • **
  • Posts: 1,133
  • Reputation: +23/-2
    • View Profile
Re: Your most annoying coding mistake?
« Reply #6 on: November 11, 2008, 06:43:26 AM »
Quote
What do you mean by: "because I stub out my functionality first"?
See the post directly above by Scion. He describes the process beautifully :)

Thanks Scion!
Idiocy - Never underestimate the power of stupid people in large groups.


 


SimplePortal 2.3.3 © 2008-2010, SimplePortal