• Jon (unregistered) in reply to mkb
    mkb:
    No, I think it's time to : NoThanksException up = new NoThanksException(); throw(up);
    It works better in C++:

    Drink up; throw up;

  • David Cameron (unregistered) in reply to J Random Hacker
    J Random Hacker:
    :
    Did anyone else wonder if this guy was related to Sarah Connor?

    No, but I was thinking that if John Connor was the student, we would all be doomed.

    It might be the only way to bring skynet down.

  • Wes (unregistered)

    The guy is learning how to program. I thought we avoided classroom submissions -- we've all done stupid stuff in class.

    Also, java is not an acronym.

  • Alchymist (unregistered) in reply to
    :
    Did anyone else wonder if this guy was related to Sarah Connor?
    Yes
  • Simon (unregistered) in reply to daves561
    daves561:
    The real WTF is that the author of this site keeps writing "Java" in ALL CAPS.

    It's not an acronym.

    Yeah, Java Ain't Verifiably Acronymic!

    I also thought the most amusing part of this code chunk was the evaluation "if (male == female)". Next we will start questioning the impact metrosexuality has on people's ability to logically evaluate.

  • iw (unregistered) in reply to steven22
    steven22:
    reminds me of my first programming attempts in 7th grade using basic
    Hell, it reminds me of my first programming attempts in BASIC when I was 5.
  • nelle (unregistered)

    no WTF's since 02.02. What happened to the world ?

  • Mr.<undefined> (unregistered) in reply to mcbeev
    mcbeev:
    if(male == female)

    heheheheheheh

    return transformist;

  • Roger Wolff (unregistered)

    about time-pressure leading to "bad code" being sent in for an assignment....

    In my first programming class, they wanted us to learn how to work with pointers. So the assignment was something like: read a file with datarecords, store them in memory, and then sort them.

    The whole idea here is to swap the pointers and not the data around while you're sorting.

    After messing around with that for over 10 minutes, I couldn't get it to work by swapping the pointers. (I kept getting the equivalent of what is now a segfault) So I swapped the whole data-records. I knew I could get it to work, as I'd already done much more complicated things with pointers. I just didn't want to spend the time on the stupid assignment. The TA didn't notice. Problem solved.

  • Arnold (unregistered) in reply to

    John Connor? I've been looking for his mother. I'm a friend of Sarah Connor...

  • Unforgiving Anonymous (unregistered)

    I'm surprised no one has pointed out yet that the student has apparently neglected to learn about loops, yet takes the time to apologise for making his program a heaping heap of excrement. Manure. Post-consumer nourishment. Sewage. Crap. SHIT!

    So deep down somewhere he understands that loops would've been required to get something reasonable done. He knows this, yet elects not to even try. It's like the catholic who goes and stabs his neighbour so he'd have something to confess about.

  • Strainu (unregistered)

    Well, I could give you many such examples (not from a CS student, though). I remember a highschool colleague which coded a "Five in a row" game in VB in a simmilar fashion. It was back in 2000 when all we had was a AMD K6-2 at 500MHz. The code was so big it wouldn't compile on our processors :) He had to ask a more wealthy friend who had a (top of the line) 900MHz processor to compile the program. Which, btw, worked just fine, unlike the one in the article.

  • afslav (unregistered)

    This reminds me of a programming competition I was in once. My team consisted of high school students who had never taken a computer course, let alone a programming course, whereas our competitors were all AP Comp Sci students. We destroyed them all anyway, but there was one team that stood out.

    One of the problems was to take a number as input, and print it out in English: 705 => Seven Hundred And Five It had to work for all numbers between 1 and 1000. Of course, this wasn't a very hard problem, and if it weren't for having our solution fail for having extra whitespace(!), we would have had it done in 10 minutes. This other team spent the entire 4 hours on the problem, and produced a 4000 line C++ program, with each possible number and output enumerated. They submitted it near the end, but it failed.

  • I can't belive I am actually posting this... (unregistered) in reply to Anonymous
    Anonymous:
    1% because the student indented it properly. 1% because they don't try to do too many things on one line, rendering it unreadable.
    Here are two lines of code from a (functional!) Game of Life implementation. I was writing it in the middle of night, so my brain wasn't functioning fully.

    The comment: //WHY OH WHY DID I MAKE THIS A SINGLE LINE!?!?

    The line: inline bool Life(int x, int y){return ((((map[x+(((x==19)-20)+1)][y+(((y==19)-20)+1)]+map[x+(((x==19)-20)+1)][y]+map[x+(((x==19)-20)+1)][y-(((y==0)-20)+1)]+map[x][y+(((y==19)-20)+1)]+map[x][y-(((y==0)-20)+1)]+map[x-(((x==0)-20)+1)][y+(((y==19)-20)+1)]+map[x-(((x==0)-20)+1)][y]+map[x-(((x==0)-20)+1)][y-(((y==0)-20)+1)])==3))||((map[x+(((x==19)-20)+1)][y+(((y==19)-20)+1)]+map[x+(((x==19)-20)+1)][y]+map[x+(((x==19)-20)+1)][y-(((y==0)-20)+1)]+map[x][y+(((y==19)-20)+1)]+map[x][y-(((y==0)-20)+1)]+map[x-(((x==0)-20)+1)][y+(((y==19)-20)+1)]+map[x-(((x==0)-20)+1)][y]+map[x-(((x==0)-20)+1)][y-(((y==0)-20)+1)])==2&&(map[x][y])));};

    There were not one but two bugs in that horror, so I guess Coding Karma reared it's head.

  • Steve Urkel (unregistered)

    Oh god...

    • brain fizzles *

    Reading that almost successfully tempted me to pour my cup of coffee in my face...

Leave a comment on “So Bad It Needs An Apology”

Log In or post as a guest

Replying to comment #:

« Return to Article