Programmers - Fess Up!
Results 1 to 9 of 9

Thread: Programmers - Fess Up!

  1. #1
    Senior Member
    Join Date
    Aug 2001
    Posts
    356

    Programmers - Fess Up!

    OK... This should be a fun one.

    What is the worst mistake you have ever made when doing code? I'll be the first to step forward and admit my mistake.

    I was working on an internet shopping cart application. And when adding the total of the order up I forgot to declare the cost of one item as an integer and it defaulted as a string. Well when the total got added up it ended up combining the two values as a string instead of a number. So 400+20 would end up equaling 40020 instead of 420. This bug went on like this while the site was up live for about a week before I noticed. What an embarrassment. But I think it happens to the best of us.

    Now who else will step forward and admit their mistakes?
    An Ounce of Prevention is Worth a Pound of Cure...
     

  2. #2
    Senior Member
    Join Date
    Feb 2002
    Posts
    133
    I wrote an encryption program and because I was a serious hurry I used boolean expressions (this was a long time ago) to test if the password was correct and instead of using "equals to" I accidently used "not equals" to so any password except the correct one would be accepted. Somehow this mistake survived the debugging stage and the testing stage without being noticed (I still can't understand how the testers missed it) and the product was distributed with this mistake. We didn't discover the fault until coustomers began complaining.

    (IMHO unrealistic deadlines are the cause for a very large percentage of bugs in software, as was the case that time).
    If you don\'t learn the rules nobody can accuse of cheating.

  3. #3
    Junior Member
    Join Date
    Apr 2002
    Posts
    18
    i don't work programming on my job, but i just learn for fun. So i don't have many experience. But a mistake i've made was when i was writting a code on VB and i change the name of a form to frmain1, but i still i was writting the whole prog by calling the form Form1. So when i finished the coding i went to compile it and it said that it had a mistake. Then i was searching, but i couldn't find it. Then after a month i have given it to a friend he told my stupid mistake.
    -isn't it stupid?
    -YEAH!!!
    -I know i know.
    h f
    o kodika einai panisxiros

  4. #4
    Senior Member
    Join Date
    Aug 2001
    Posts
    356
    Yea... it's always the little things that kill you. I remember when I was learning php. I spent hours trying to find out why a page I created wasn't working. Then I noticed one lousy stinkin semi-colon was missing. Always the small things.
    An Ounce of Prevention is Worth a Pound of Cure...
     

  5. #5
    Senior Member
    Join Date
    Nov 2001
    Posts
    472
    I once made a medium sized web application for a company togehter with some guys from school. When it was nearly finished I somehow was assigned to install and maintain the app.

    The app worked fine on the developing machines, but on server..... Man, I got all kinds of memory leak errors. Damn, I think I debugged for something like a month and couldn't find the bug. At last I found it, it turned out some ready made components I used failed on the web-server of the machine I was to install the app onto.

    Actually, I think I spent more time debugging than me and the guys spent programming in the first place. Well, lesson learnt I guess. Now I always build my applications onto several machines during the development process. BTW, did you know that's a well-known tecnique from the software-industry? It's called "Build every day & smoke test". Was used when creating NT4.
    ---
    proactive

  6. #6
    Senior Member
    Join Date
    Jan 2002
    Posts
    227

    Smile

    I made something similar as jared_c.
    I was writing a program for cashbox in pub. It should manage bills of all customers in pub. It should be also able to allow people from one table to pay separately. That was done in this way - when the first one paid his bill the program cleared his items... But I forgot one little thing The program cleared that guy item list but didnt decrase the cost of whole bill... So even item list was clear the sum was still as high as before

    Hope you get my point because my english is going worse and worse Damn!)

  7. #7
    AntiOnline Senior Member souleman's Avatar
    Join Date
    Oct 2001
    Location
    Flint, MI
    Posts
    2,884
    I wrote a program that would exploit holes in sendmail, then send itself on. While, I didn't want to overcrowd any one machine, so if it had already been hit, I didn't want to hit it again. I also wanted to make sure that the sploit couldn't be stopped by just putting a file with the same name on the computer. So I said that if the file already existed, there was a 1 in 7 chance that it would be infected again. While, I should have made it 1 in 7000, because it crashed a lot of machines very quickly.

    Oh wait, that wasn't me, that was RTM. Sorry, brain fart.

    My most anoying mistake is syntax errors in cobol. Those are a bitch (excuse my language) to find.
    \"Ignorance is bliss....
    but only for your enemy\"
    -- souleman

  8. #8
    The Iceman Cometh
    Join Date
    Aug 2001
    Posts
    1,209
    A problem that I commonly see students at my university make is trying to access memory slots which haven't been assigned (such as trying to write to array position 6 when there are only 5 positions, or not properly coding linked-lists and having gaps in the list). Most compilers will catch these and throw warnings, but the lower divison CompSci classes (which I grade for) are required to use xlC in Unix, which will compile the code without any problem. When the programs are executed, however, the program throws a segmentation fault followed by a core dump. I've seen students spend hours trying to fix a 20 line C++ program simply because the loop they were using to fill the array looped one time too many and placed a value in an undeclared memory location.

    AJ

  9. #9
    Senior Member
    Join Date
    Nov 2001
    Location
    Ireland
    Posts
    735
    I find that I do this a lot:

    IF (condition)
    {
    // do something
    }
    else
    {
    // do the same thing
    }

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •