Miriam Parkinson

  • Home
  • About
  • HET228 & HET225 Notes

The joy of bug killing

admin | April 11, 2007

I am very happy to inform everyone that I have finally killed a really particularly annoying bug that was killing my programming assignment.

It was one of those bugs that turns up and bothers you just when you’re starting to feel really pleased with yourself, and the stellar job you’ve done on the program so far. This particular bug decided to jump out at me and ruin my day just as I added the finishing touch to the assignment. The problem was the deceptively simple requirement that the program should have a nice little ‘Would you like to enter another route (Y/N)’ at the end. Yes ladies and gentlemen, all this particular part of the program had to do was ask for an input and start over if you indicated Y.

The problem lay in the fact that whilst the program ran through fine the first time it would skip the first input the second time around if you selected ‘Y’ (it exited fine if ‘N’). I was, of course, programming in C++ and I fixed the problem by replacing cin.getline(restart, 2) with cin.getline(restart, 2, ‘\n’) which (correct me if I’m wrong) is strictly speaking THE SAME THING!!! Anyway, problem solved, no suddenly empty inputs, program no longer chucking a skitz and crashing. Hooray!

To those who don’t program I can’t express to you how annoying it is to get to the end of a project and then have something really stupidly simple screw you up. Its sort of like winning a marathon only to be disqualified because you forgot how to walk when it came to the receiving your accolades bit. So having proven that walking is the same as running only slower I have fixed my problem and vastly improved my mood.

More importantly I have discovered that ‘Mark Leung’s Crazy Computer Bug’ makes a surprisingly accurate reenactment of those bugs that sneak up on you when you least expect it… Only its never made me want to throw my computer out the window or cry.
[youtube=http://www.youtube.com/watch?v=RUCZJVJ_M8o]

Categories
Education
Tags
Assignment, Bugs, C++, Programming, University
Comments rss
Comments rss
Trackback
Trackback

« What I (used to) do A Break »

Leave a Reply

Click here to cancel reply.

Categories

  • 101 goals in 1001 days (8)
  • About Me (10)
  • Blogs (6)
  • Career (1)
  • Education (10)
  • Events (3)
  • Experiments (5)
  • General (127)
  • Humour (6)
  • Opinion (5)
  • Photography (4)
  • Podcasts (5)
  • Productivity (7)
  • Projects (2)
  • Reviews (2)
  • running (1)
  • Sites (1)
  • Software (1)
  • Uncategorized (3)

Archives

  • June 2011
  • January 2010
  • December 2009
  • August 2009
  • April 2009
  • March 2009
  • February 2009
  • January 2009
  • December 2008
  • October 2008
  • August 2008
  • July 2008
  • June 2008
  • November 2007
  • July 2007
  • June 2007
  • May 2007
  • April 2007
  • March 2007
  • February 2007
  • January 2007
  • December 2006
  • November 2006
  • October 2006
  • September 2006
  • August 2006
  • July 2006
  • June 2006
  • May 2006
  • April 2006
rss Comments rss valid xhtml 1.1 design by jide powered by Wordpress get firefox