Dirty Coding Tricks To Make a Deadline
Gamasutra is running an article with a collection of anecdotes from game developers who had to employ some quick and dirty fixes to get their products to ship on time. Here's a brief excerpt:
"Back at [company X] — I think it was near the end of [the project] — we had an object in one of the levels that needed to be hidden. We didn't want to re-export the level and we did not use checksum names. So right smack in the middle of the engine code we had something like the following. The game shipped with this in: if( level == 10 && object == 56 ) {HideObject();} Maybe a year later, an artist using our engine came to us very frustrated about why an object in their level was not showing up after exporting to what resolved to level 10. I wonder why?"
Have you ever needed to insert terrible code to make something work at the last minute?
Oh how I wish I had modpoints. That gave me a good laugh before bed :D +1 point for you, good sir.
Seriously? In English that wouldn't be so funny. It'd be roughly: security is non-existent. So just because it's written in C / C++, it's suddenly a joke? Give me a break.
As a programmer it scares me genuinely to see your post get rated +5 Informative. GOTOs have no place in man made code. There are so many reasons why not to use GOTOs, and only very few situations that GOTOs make for cleaner code (specifically, the usually implemented break, last and next GOTO surrogates). If one of the people in my team uses GOTOs I tell them off.
A brief study of the pros and cons: http://www.stevemcconnell.com/ccgoto.htm
As you can tell from that, and many other sides, there are no major pros to using GOTOs, but very major negatives. Many modern languages don't support GOTO, or only include it to support machine generated code (ADA).
Have you counted the number of GOTOs in the linux kernel?
'For we walk by faith, not by sight.' II Corinthians 5:7