Twilight Guild Forum

World of Warcraft => Rants => Topic started by: un4 on October 28, 2008, 06:02:20 PM

Title: Debugging
Post by: un4 on October 28, 2008, 06:02:20 PM
I -hate- coding.  The actual work isn't bad, until you're doing what (you think) are your final compilations and getting ready to test the program.  That's where it hits the fan for me.

I just spent an hour and a half of nonstop work searching through my code (34 errors showing) to figure out what I messed up.

for(int i = 0; i < myArray.length; i++); {

Turns out I put a semicolon after a for loop and that f'ed EVERYTHING up.  Who came up with this shit?  One semicolon destroys a 70-line program.  Honestly.
Title: Re: Debugging
Post by: kaylasb on October 28, 2008, 06:18:56 PM
Noob!!!  :Pumpkin: j/k

Hehe yeah i have experienced something like that a couple times :scared_cat:
Title: Re: Debugging
Post by: un4 on October 28, 2008, 06:26:58 PM
Doesn't it make you want to punch something in the throat?  It didn't even have the decency to be a problem with my logic or commands... it was a freakin' semicolon...
Title: Re: Debugging
Post by: Kothnok on October 29, 2008, 01:16:28 AM
Learn programming in Pascal instead of C, makes things so much easier to understand so you can catch crap like that ;

Formatting techniques help a lot too, find one you're comfy with and stick to it.

I do this kind of thing for a living.  I know all about it and then some.
Title: Re: Debugging
Post by: Emmalina on October 29, 2008, 01:23:17 AM
There's a C course required for Physics majors here at the U, and I'm actually glad I learned C first. Because it's such a pain, you get thrown in the deep end of the pool and other higher level languages seem much easier.

That said, every program I've ever written in C has contained memory about as well as a chain link fence contains water.
Title: Re: Debugging
Post by: un4 on October 29, 2008, 07:22:52 AM
Java... required.   >:(

Crap language doesn't even support multiple arrays, just arrays of arrays.
Title: Re: Debugging
Post by: Kothnok on October 29, 2008, 09:34:41 AM
The most difficult debugging project I had was tracking down why database table indexes kept getting corrupt under heavy multiuser-use.  Fixing the bug was top priority as if it continued, the company would fold over such a failure (3rd party code, but what does that matter to the client?).  I crammed 30 weeks of time into 12 and ran network tests day and night waiting for file corruption to take place (writing detectors for when it occurred) and basically playing the part of a particle physicist observing the debris after the crash and puzzling over how it happened and how to solve it.  It was a bug that once you detected the error, the problem went away.  Weeks of poking, prodding, theorizing and testing.  It all came down to Linked List Updating.  Breaking the links in the middle in order to insert a new item is standard stuff, but when you need the chain to be unbroken 100% of the time, breaking the links even for 0.001 seconds can be disastrous. I ended up creating a duplicate entry with duplicate links so that in the infinitesimal time it needed to redirect old links and create new ones to insert a new item, the process did not "break the chain" and lead to index corruption and eventual database destruction.  After the new item was inserted and all the links to and from it were updated, then it was safe to delete the old links as they were no longer needed.  Kind of like a detour on a highway while they fix some patch of the road.

My friends and coworkers at the time called it a "NASA fix" as all of my work was highly theoretical and the only way to prove it's worth is to send it up and see if it flew. 
Title: Re: Debugging
Post by: Arcdelad on October 29, 2008, 09:40:09 AM
I picked lice out of my sister's hair once...also ticks off of my dog...
Title: Re: Debugging
Post by: usonian on October 29, 2008, 09:42:00 AM
I think I need one of these to understand what you guys are talking about:

[attachthumb=1]
Title: Re: Debugging
Post by: un4 on October 29, 2008, 10:01:29 AM
NASA fix... I like it :P
Title: Re: Debugging
Post by: Avelandra on October 29, 2008, 11:35:48 AM
Imagine working in the olden days where you would take your program to the surly graduate student and they would run it and send you the output in about a week.
Title: Re: Debugging
Post by: Grendeel on October 29, 2008, 11:40:02 AM
LOL

C+  had just been introduced to education the year i graduated.  Advanced Basic had 2 courses in my program.  Boy do I feel old reading this post.   Try programming in COBOL. I found that extremely annoying to debug.  C+ was a breeze compared to it.
Title: Re: Debugging
Post by: Kothnok on October 29, 2008, 05:01:47 PM
*take a trip thru memory lane*

My middle school education had a portion where we learned how to use the Timex Sinclair (http://oldcomputers.net/ts1000.html) (it had 64k of memory!) which my teacher replaced at his own expense with 20 Atari 520s (http://oldcomputers.net/atari520st.html) running Atari BASIC (http://en.wikipedia.org/wiki/Atari_BASIC) in the middle of the year.

The one class in high school offered was taught by the typing instructor and he just read from the TRS-80 (http://oldcomputers.net/trs80iii.html) (Trash-80) instruction book.  I also took Fortran at the local college during high school, but I dropped it after 2 months because I had no clue what was going on.  Took a few more courses once I got to college and eventually graduated with a degree in Computer Science.