Debugging

Started by un4, October 28, 2008, 06:02:20 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

un4

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.
un4

kaylasb

Noob!!!  :Pumpkin: j/k

Hehe yeah i have experienced something like that a couple times :scared_cat:

un4

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...
un4

Kothnok

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.
No matter how often you refill the gene pool, there's always a shallow end.

Emmalina

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.


Set progress: D0/D1: 2/8, T1: 4/8, T2: 3/8, T3: 0/9, T4: 4/5, T5: 3/5, T6: 2/8, T7: 1/5, T8:4/5, T9: 3/5, T10: 0/5

un4

Java... required.   >:(

Crap language doesn't even support multiple arrays, just arrays of arrays.
un4

Kothnok

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. 
No matter how often you refill the gene pool, there's always a shallow end.

Arcdelad

I picked lice out of my sister's hair once...also ticks off of my dog...

usonian

I think I need one of these to understand what you guys are talking about:

[attachthumb=1]

un4

NASA fix... I like it :P
un4

Avelandra

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.
"Quando Omni Flunkus Moritati" - Possum Lodge Motto
I'm pulling for you, we're all in this together.

Grendeel

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.

Kothnok

*take a trip thru memory lane*

My middle school education had a portion where we learned how to use the Timex Sinclair (it had 64k of memory!) which my teacher replaced at his own expense with 20 Atari 520s running 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 (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.


No matter how often you refill the gene pool, there's always a shallow end.