Programming Marathons?
Mattygfunk asks: "Coming to the submission date of a major university project the other day, myself and another group member coded in XHTML/CSS and ASP (yuk!) for 27 hours straight to complete it. What is the longest Slashdot readers have coded in a single session? Apart from being more organized and having plenty of coffee, do you have any tips on getting through ultra-long coding sessions?"
What is the longest Slashdot readers have coded in a single session?
10-15 minutes tops. phew..
cpeterso
Don't let the cleaning company set the alarm on you.
I got an adrenaline boost once when a cop pulled his gun and started screaming at me. I had been running around in my socks, checking on a couple of systems. This guy was seriously amped and very pissed when he found out that I didn't deserve a beating. Luckily his partner was calm, and chuckling a little. The cop that was pissed kept asking me what my boss would do if he knew I was working all night. All I could do was laugh and tell him my boss better damn well be pleased. That didn't help the situation...
Yeah. Grey ones.
-WolfWithoutAClause
"Gravity is only a theory, not a fact!"Herpies. Every time I've done a several day burnout project, I've ended up with a painful patch of herpies. Stress reaction or something.
"Eve of Destruction", it's not just for old hippies anymore...
In short, don't do it. If it doesn't get done, don't do this.
Posting Anonymously...
In school, I was working on LISP assignment for like 24 hours straight. I couldn't figure the damn thing out (HUGE LISP program, like 9 or 10 pages) I don't remember what the assignment was, now I could do it no problem. Anyways, about 11am the day it was due, I said fuck it. I'm going to get drunk. About 3 pitchers of beer later, it was class time. I decided I was way too drunk to go, so of course I strolled by the classroom window and mooned it. Hopped in my car, drove down to the local sports pub, where I met a nice lady in her 50's and proceded to go down on her in a booth at the bar. I then passed out in a puddle of my own vomit near the front gate of my apartment complex. Woke up with a massive hangover, a bloodied chin, and no wallet.
So, lots of people are giving good advice and bad advice. This is my advice:
No matter how enticing it seems, don't do what I did.
(P.S. I know a few folks from my old school read slashdot and if this story sounds familiar please refer to me by my handle or first name.)
Cheers
Excellent start. vi is the proper editor for these sessions.
The problem with Emacs? You're writing a lexer. You probably have a bunch of similar-looking statements for various keywords. Each statement is probably a little bit different, so cut-and-paste becomes tedious. Or, perhaps you have a table of thirty numbers in hex, which change using some complicated pattern. Perhaps there's some way to automate this, so you can lay out some sort of table, and have Emacs generate code and automatically indent it? Of course Emacs can do that. Why, all you have to do is read in the first character using thing-at-point, convert it to an integer and then use a bit of recursion...of course, this could be more generally useful, so you might as well add it to your .emacs - ah, but you forgot to call save-excursion, so it's not a very user-friendly function...
STOP! No Lisp programming. Must write lexer.
Warmth. I find if I'm at home and dont put a pair of socks on I curl up in my seat, not very efficent
No, no, no. Must keep it cold. When it's warm, it's too easy to fall asleep. The colder, the better. If the temperature bothers you, repeat after me: Cold is the mind-killer. I will allow cold to pass over me. Cold is the mind-killer.
Incremental backups. maybe a cron job, tar your files at least every hour, preferably every ten minutes.
One word: CVS :) Important for larger projects, critical for marathons. cvs diff can answer the eternal question of "WTF was I thinking?"
Dont be hungry. Start getting hungry? Order a pizza (online).
Again, too easy to fall asleep after eating. Warm with full belly = nap time.
My own suggestion? Lots of liquids. You can only consume so much caffeine before experiencing psychadelic effects, so you'll also need water, and lots of it. This is not a preventative measure, but is rather disaster recovery: if you do fall asleep, you won't sleep long before the call of nature, and when you get up, you'll feel so guilty about "lying down for a moment" that you'll write your best code.
Good luck with the project - I imagine you're probably at the parser at this point, so go get those S/R conflicts :)
Here are some tips that I find especially useful for a session like this -
-There more concentrated the caffine solution, the longer you can remain awake without having to pee.
-Prepare all food and string in a mushy liquid-like substance, it will save on precious coding time.
-Remember all of the corner-cutters that you were told never to take? They are now your best friends.
-Do not bring any firearms into the room.
-If you wish, bring music, but be sure it doesn't have words to it or give you an urge to dance.
-If nature calls, wait until it's SCREAMING!
-If another person(s) will come within 100m of you during the coding time (and are not on the team), be sure to have restraining orders in effect.
-And most of all - have fun (well, maybe not).