The closest I came was telling a co-worker "I won't leave until I get this done". I was there until 2 AM. At midnight, I was looking down at a printout (yes, I'm old enough to have worked with those), and my glasses slipped off and broke as they hit the edge of the table. I worked the last two hours leaving nose prints on the screen (not literally, but close).
I think people that frequently pull all nighters (i.e. those claiming to do so multiple times per week) are probably missing the point that they'll get more work done with ~6 100% productive hours per day, than 18+ hours at fastly reduced productivity. It's not sustainable.
But as an adult, writing code, never. By this time in life, I’ve used up whatever sleep reserves have. If I were to stay up for a night, I’d not be able to function the next day.
Kids keep me up at night too much anyway. :)
1. A project for a client that needed to be done "yesterday". It was a 3 day 1 night project that we charged double for because of the timeline.
2. A multi-million 1 month project that we spent the final week working 100 hours/week. Project management got me a massage chair to sleep in at the office, bought and delivered whatever food I wanted.
3. When my daughter was less than 1 year old and I was freelancing. Days were distracting so I worked nights.
4. Bootstrapping my startup, regularly doing 100 hour weeks for a year. I was burnt out for a year after selling the startup.
In summary, I only recommend it for urgent projects. It's productive for the first 5 nights but after that, productivity drops drastically. Sleep debt is even worse than technical debt.
How the hell did you not crash after the second one? I’m pretty sure I begin having auditory hallucinations after just one all-nighter!
I've done 96 hours before and I could only do borderline mindless tasks at 20% efficiency, let alone programming.
It's possible to get a few hours each night, work literally every waking hour and be productive for weeks on end (at great peril of course), but for most developers I'd wager productivity is drastically reduced after 48 hours, and almost completely gone by 72.
Recent science says sleep deprivation actually incurs brain damage, so it's definitely never a good idea except for emergencies.
I did get about 6 hours a sleep, just didn't see my pregnant wife, or do anything besides eat, sleep, code. It led to a lot of burnout, and I later quit tech to run a cafe.
For fun, every now and then. Not a regular thing but it's fun to pretend to be in your early 20s.
I actually just can't stay awake if I'm overly tired. I will fall asleep anywhere, including driving. I don't commute but I try to avoid it anyway, since I'll (involuntarily) sleep during work-hours to make up for what I lost.
No project I've worked on has been that important, though I can think of some situations that would be.
I have left the office after 8pm (11-12 hour day) a handful of times, mostly when I broke things late in the day, or when we were migrating something large during off-peak hours.
I don't consider working late a valuable tool to have in my toolbox. I'd rather deliver ahead-of-schedule, estimate more appropriately, and turn down work that is overly high-pressure.
FWIW I'm an employed developer and my employer would never ask me or anyone else to do this, in my estimation.
There’s very rarely any benefit in trying to work when you’d usually be asleep.
It’s arrogant to believe one could work 16+ hours without any productivity gains being significantly offset over the following days.
It's a lot easier for me to stay up all night if I am outside doing something, but that is rare.
I'm honestly not sure I could stay up all night even if I wanted to at this point (age 32, if that matters).
Never again and looking for new team now :)
Before that? I had to be maybe 14.
I rather finish what I'm doing and sleep after.