View more

View more

View more

### Image of the Day Submit

IOTD | Top Screenshots

### The latest, straight to your Inbox.

Subscribe to GameDev.net Direct to receive the latest updates and exclusive content.

# Late night coding

4 replies to this topic

### #1jellyfishchris  Members

Posted 26 February 2013 - 11:14 PM

POPULAR

While finishing off a uni assignment with 4 other programmers at around 3am in the night, you start to write some sloppy code. We didn't notice until we decided to review the code after submitting... For the record we already check if the program worked, which it did.

Here is an example of what we found a few days later (snippet taken from a FishController class)....

        if (dt == 0.0f)
{
dt = 0.0f;
}
else
{
dt = diff.total_milliseconds();
dt /= 100.0f;
}


### #2cardinal  Members

Posted 26 February 2013 - 11:43 PM

As a former Teaching assistant at my University, that code would probably rank as some of the better code I've seen from University students.

While a bit unfair to poke fun at student code, it's always good to have a good laugh at yourself once in a while.

When I was a student I'd always have a bunch of "well it worked yesterday" moments due to late night coding gaffs.

Posted 28 February 2013 - 11:57 PM

I look at a lot of my University Assignments when I submit them and I go "I love this code.  Great looking code."  Then a week later I'll look at it again and be like "what is this crap?"

Last semester I had to pull an all nighter to finish a programming assignment for my University.  At about 4:30 in the morning I ran into one last bug that was keeping it from being finished.  It was killing me.  I finally said w/e I'ma go to bed.  When I finally woke up I found and fixed the bug in literally one minute at looking at the code again and the mistake was a simple mistake that happens when you first start programming.  Oh I love late night coding.  lol.

### #4Khatharr  Members

Posted 02 March 2013 - 04:11 AM

May years ago when I was still young and handsome I'd literally stay up for days on end continually manufacturing and consuming iced tea and writing Ruby scripts for RPG Maker. Toward the end of the consciousness curve I'd generate some really really scary stuff that would actually run correctly. I'd end up passing out at the desk and after convalescence I'd look at the gibberish I'd written and not be able to understand how it worked.

Edited by Khatharr, 02 March 2013 - 04:12 AM.

void hurrrrrrrr() {__asm sub [ebp+4],5;}

There are ten kinds of people in this world: those who understand binary and those who don't.

### #5Overman  Members

Posted 05 March 2013 - 10:47 AM

My roommate pulled off somethings similar one night. After working all day on a project, we were both stuck at the same point and could not get any further. We gave up for the day and went out drinking with friends. That night, my roommate decided to do a little coding on the project. When he woke up the project was working and he couldn't remember what he had done to fix it. That was the only time when drunk coding ever paid off. All the other times I've seen it the results were less than spectacular.