Thread View: alt.folklore.computers
4 messages
4 total messages
Started by Gordon Edwards
Fri, 17 Aug 1990 20:17
Stupid programming errors.
Author: Gordon Edwards
Date: Fri, 17 Aug 1990 20:17
Date: Fri, 17 Aug 1990 20:17
25 lines
1870 bytes
1870 bytes
In light of the stupid user discussion, how about a discussion of stupid and embarrassing programming errors. A number of years ago, I was working my way through school at a small company who performed physical inventories. I was responsible for programming and any other computer related work (having a DP staff of me). I wrote an application for a particular client who wanted to download a list of product identifiers so that data from the inventory could be validated. I received a test tape of these product IDs and proceeded to develop a sexy recursive function to insert the IDs into a linear list. Everything worked fine on the test data. I had a habit of showing up at the first inventory that was using a new system, and so when the crew leader started up the application, and it promptly blew up, I was there to fix it. I looked at the error message and found the dreaded "Stack overflow"; the test tape only had a SAMPLE of the real data (about 1%) and the recursing had filled up the stack with function calls. I quickly wrote a safe iterative function to build the list while the crew- leader kept the store manager busy. Needless to say, I never write production code with recursive functions anymore. -- Gordon Edwards Mead Data Central, Dayton OH
Re: Stupid programming errors.
Author: Steve Sears
Date: Thu, 30 Aug 1990 22:21
Date: Thu, 30 Aug 1990 22:21
30 lines
2188 bytes
2188 bytes
In article <1172@meaddata.mead.UUCP> mead!gor...@uccba.uc.edu writes: >In light of the stupid user discussion, how about a discussion of stupid and >embarrassing programming errors. > While I attended University I worked at the Library Automations, primarily doing applications with some systems programming stuff. I had just finished writing an interface between the big IBM's and a little Honywell 5 running the Pick operating system, which was the university check writing machine. This was for the financial people at the library and the University. Someone in the accounting department notices that they are loosing all kinds of money because the old application did not handle some case or another, and because I had just been in there, I was asked to provide some new whizzy stuff. Everybody wanted this real bad, so I went into hacker mode and turned it out in a few days, with extra bells and whistles that I could see they would need soon. It went into production after we proved that it would do the job with the previous months data. After that, everything went real well for a month or so. One day I walk into work, and there are the library and University MIS people, along with a couple University vice presidents, and they are not happy. They explain that the previous night a check had been written for $216,420,138.90, and they wanted an explanation. Turns out that someone decided to process a credit into the system by writing a check for a negative amount. My program didn't know what to do with the '-', so it just deleted it from the ascii input, effectively concatenating two amounts together; a $216.42, and a $138.90 with a leading zero. University people have no sense of humor...
Re: Stupid programming errors.
Author: wa... David Wald
Date: Fri, 31 Aug 1990 20:53
Date: Fri, 31 Aug 1990 20:53
25 lines
2030 bytes
2030 bytes
In article <1172@meaddata.mead.UUCP> mead!gor...@uccba.uc.edu writes: >In light of the stupid user discussion, how about a discussion of stupid and >embarrassing programming errors. [Story of a recursive function overflowing the stack on a long input.] There are programming mistakes that can result, not from stupidity, but simply from moving to a different type of programming language. A few years ago a friend at school showed me a program that had worked fine when she'd tested it, but came back from grading with the supremely unhelpful message, "This dumps core." The assignment was a short filter written in C. The problem was that her previous programming course had used Scheme, emphasizing general programming techniques. Scheme guarantees that it will compile a tail-recursive function into a loop. Her filter code, while beautifully written, was handling the main loop of the filter tail-recursively, and the program overgrew the stack as soon as the TA gave it too many characters of input. She looked rather shocked when I told her that most C implementations wouldn't handle that case nicely, but she recoded it into a while-loop. -- ============================================================================ David Wald wa...@theory.lcs.mit.edu ============================================================================
Re: Stupid programming errors
Author: mnyk...
Date: Wed, 05 Sep 1990 11:10
Date: Wed, 05 Sep 1990 11:10
9 lines
959 bytes
959 bytes
An acquintance of mine was hired to speed up a COBOL accounting program
which used some 8 hours to process some 1000's of transactions. She
discovered that the program processed the first transaction, then
REWOUND the file, sought the second, bypassing the first, rewound,
sought the third, etc.. Instead of some 1000's of file operations the
program performed some 1000000's!
--
Matti Nyk{nen CS Student at Helsinki U, Finland
Trepanation! email: mnyk...@cc.helsinki.fi
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads