News for hackers. Stuff that matters.
Re:Waking up at 5am to code by nhashem on Monday January 23, 2012 @03:36AM (#3499586)
A lot of commenters have talked about the pros of this routine, and there are many. Few interruptions, working while your mind is fresh, working within a regimen, etc.

However, if you don't have an equivalent amount of discipline on at night to get enough rest, you will quickly burn yourself out. I did this routine for a lot of the second half of 2011, and since I'm a night owl by nature (going to bed at 12 midnight is 'earlyish' for me), the lack of sleep quickly caught up with me. My project was actually getting some traction though, so I basically spent about four months in a sleep-deprived haze and consuming about 400 mg of caffeine a day just to function.

So I guess what I'm trying to say is, if you're like me and you go to bed at 1AM, wake up at 9AM, and go into work at 10AM (a very common engineer schedule), then it's not just a case of setting of your alarm clock but really adjusting your lifestyle so you're not fundamentally sleep-depriving yourself.

Re:Waking up at 5am to code by tomkarlo on Monday January 23, 2012 @08:58AM (#3500330)
The caffeine is a vicious cycle (I've been there.) When you're short on sleep, you need it to get through the day, but the side effect is you end up staying up later than you need to. Also, if you want to get to sleep, avoid screens (TV, computer) for the last hour or two before bedtime and you'll find it's a lot easier (E-ink readers like the Kindle are great for this.) It's hard to switch gears from the stimulation of TV or a game and go to sleep unless you're already overtired.

A lot of this also depends on age, I suspect... I used to be a 1AM-type person in my 20s but as I've grown older, I find I naturally wake up at 7 AM or so anyway. By 11pm or so, I'm geting pretty useless. My sense is this happens to lots of folks as they get into their mid-30s, even if they don't have kids.

Re:Waking up at 5am to code by jonstjohn on Monday January 23, 2012 @02:44PM (#3501783)
I was a serious coffee drinker that switched to black tea and finally down to green tea. I've found (and read) that small doses of caffeine are much better for concentration and productivity. I generally have 2-3 cups of green tea a day, get a slight boost in mental alertness, but never get the 'crater' effect of over-consumption. Bonus: I never wake up craving caffeine or needing that first of the morning jolt to become coherent.
Re:Waking up at 5am to code by BCM43 on Monday January 23, 2012 @10:29AM (#3500632)
Also, if you want to get to sleep, avoid screens (TV, computer) for the last hour or two before bedtime and you'll find it's a lot easier

Is there evidence for this? I've heard it's true, and it seems to be from my personal experience, but I've never seen any kind of a study of it.

Re:Waking up at 5am to code by chrisdroukas on Monday January 23, 2012 @11:14AM (#3500838)
I'm not sure about the two hour timespan, but brightness appears to have an effect on sleep latency and the time it takes to fall asleep.

Studies [edit: PDFs]: [1] http://www.journalsleep.org/Articles/250312.pdf

[2] http://www.sciencesleep.org/ziliao/Effects%20of%20playing%20...

[3] http://onlinelibrary.wiley.com/doi/10.1111/j.1365-2869.2005....

Re:Waking up at 5am to code by polyfractal on Monday January 23, 2012 @11:49AM (#3501026)
Definitely install F.lux: http://stereopsis.com/flux/

It adjusts the color temperature of your monitor as the sun goes down. As the sun sets, your monitor becomes more red/pink. It takes a little while to get used to it, but I absolutely cannot stand normal monitors at night time now. When I occasionally disable F.lux to watch a movie at night, I'm blinded by the bright blue glow.

Re:Waking up at 5am to code by derekp7 on Monday January 23, 2012 @01:45PM (#3501529)
I've recently done this, and it helps when I'm on-call and get woke up in the night. I can now fall back asleep faster. Another item that helped, I've put oil lanterns up on the walls in my home office. I just got to remember to light them instead of flipping on a light switch, and all is good.
Re:Waking up at 5am to code by bitops on Monday January 23, 2012 @11:11PM (#3503419)
That's a nice touch I hadn't thought of. Any ones you like in particular?
Re:Waking up at 5am to code by derekp7 on Wednesday January 25, 2012 @09:11AM (#3509734)
I picked up a couple of generic ones, I think they are made by Lamplight Farms. They include a bracket that hangs on the wall with a reflector plate. Other than the wall mount, most of the oil lamps are about the same (that is, the ones in the $5 - $20 range). Of course, I picked up these ones about 10 years ago, and I can't find this particular model any more. I can only find the table top ones (could probably put it on a shelf, with a mirror behind it for better effect).

You can use either lamp oil or kerosene in most of them, the lamp oil doesn't stink as bad (and if you get the "ultra pure" oil, there is hardly any smell at all). Also, last time I had a power outage I was able to keep the flame lit (on a pilot light height) through the night with hardly any oil used (and it made a nice night light -- don't know how safe it is though).

Re:Waking up at 5am to code by Create on Tuesday January 24, 2012 @06:09AM (#3504254)
for linux: redshift is packaged for most distros.

https://launchpad.net/redshift

Re:Waking up at 5am to code by jamie_ca on Monday January 23, 2012 @12:48PM (#3501295)
There are some citations on the f.lux website: http://stereopsis.com/flux/research.html

Anecdotally, when I initially switched to using f.lux on my desktop (reduces blue light levels at night) it's become a lot easier to drift off despite sitting in front of the screen until ~15 mins before bed.

Re:Waking up at 5am to code by eloisius on Monday January 23, 2012 @08:37AM (#3500279)
You should try taking 5mg of melatonin around 9pm. I have trouble falling asleep before 12-1am, too. Undeterred, I stay up too late every night working on whatever project I have and can't sleep because I'll lay awake thinking about it.

If I take a melatonin I get the benefit of becoming inept at writing code by 10 and will be sound asleep before 11 and ready to wake up hours before I have to start my day.

Re:Waking up at 5am to code by pstuart on Monday January 23, 2012 @09:18AM (#3500407)
My sleep doctor advised taking less, and earlier (1.5 mg around 5 or 6 pm).
Re:Waking up at 5am to code by polyfractal on Monday January 23, 2012 @11:50AM (#3501030)
This is good advice. Taking melatonin when you go to bed will help you sleep, but taking it a few hours before you want to go to bed helps retrain your circadian cycle (which is the goal, not just going to sleep easily)
Re:Waking up at 5am to code by whimsy on Tuesday January 24, 2012 @04:45AM (#3504103)
Do you have a source you can cite for this? I'm keenly interested in how this works.
Re:Waking up at 5am to code by hobin on Tuesday January 24, 2012 @06:50AM (#3504333)
Re:Waking up at 5am to code by gbog on Thursday January 26, 2012 @04:48PM (#3516143)
You have sleep doctors in the US? seriously?
Re:Waking up at 5am to code by pmiller2 on Wednesday February 01, 2012 @06:09PM (#3540552)
Yeah. Sleep medicine is a subfield of neurology.
Re:Waking up at 5am to code by ryanmolden on Monday January 23, 2012 @11:52AM (#3501039)
Coincidentally enough I just started reading The Way We're Working Isn't Working and this one of the arguments he makes (i.e. that we tend to run ourselves ragged by trying to work longer and longer hours to 'be more productive', when it usually results in just the opposite).

I can definitely attest to the fact that my periods of greatest productivity tend to come in spurts as the book talks about (sprints of say 90 or so minutes of highly concentrated work) as opposed to being the result of long slogs of say 10 hours of coding, which tends to produce volumes of code, but not necessarily my best code.

Good book so far (http://www.amazon.com/Way-Were-Working-Isnt-Performance/dp/1...).

Re:Waking up at 5am to code by steelaz on Monday January 23, 2012 @06:50AM (#3500032)
You couldn't bring yourself to sleep before midnight even when waking up at 5am on regular basis?

I consider myself night owl too, nowadays I fall asleep at around 1am. But I used to work in construction, getting up at 5:30am every day and just after couple weeks of this routine, I would fall asleep at 10:00pm - 10:30pm, usually while watching TV :)

Re:Waking up at 5am to code by beagle3 on Monday January 23, 2012 @10:06AM (#3500552)
I'm a night owl, and a few decades agoI was on a rigid Army training schedule for months at a time, where we would be released for the night around 1am-2am and already have roll call at 6:30am; I would still not fall asleep until 3-4 am. (This was not physical training, although we did do a short physical exercise daily, and a an hour long one three times a week)

My pre-army reserves carried me through the first 3 months, and then I would just uncontrollably crash for 20-30 minutes at lunch time. My eyesight deteriorated significantly (much improved after I started getting some sleep again, thankfully, but not as good as it used to be, unfortunately) and I'm sure my body was otherwise harmed, although I did have more waking hours than at any other time I can remember.

Re:Waking up at 5am to code by starwed on Monday January 23, 2012 @09:54AM (#3500515)
>I used to work in construction

This is why you were able to fall asleep! If I get up early (~6am) in the morning, my body just doesn't seem to care -- I won't fall asleep (or even feel truly tired) until about 2am.

Unless I actually do something physically taxing during the day.

Re:Waking up at 5am to code by nihaar on Monday January 23, 2012 @01:35PM (#3501484)
Agreed on the cons. I've tried this as well for a while and it does require a huge change in lifestyle. My gym time was cut down to nothing as I would usually get up and hit the gym prior to work (going to the gym in the evenings is very tough for me).

So although my sleep time was the same (I was still going to bed and waking up at the same time as before), by taking out my gym routine, I was actually feeling more tired, down and otherwise less alert. So I've been playing with alternating work/gym during the weekday mornings.

Re:Waking up at 5am to code by chris_dcosta on Monday January 23, 2012 @06:45AM (#3500019)
I'm a nihgt owl with kids.

I've been living on the 1am to 6:30 express(o) train for the last 5 years, holding down a job too.

It can be done, but you have to let yourself give-in sometimes.

I hit a wall every three months or so and have one day where I crash at about 7:30 pm sleeping the whole night through. That's enough to recharge my batteries.

Did I mention I'm no spring chicken either...

Re:Waking up at 5am to code by notyourwork on Monday January 23, 2012 @07:06AM (#3500065)
I can say from watching my father do this while I grew up that this is extremely unhealthy on the body. Sure you can do it, sure you can recharge every few many months but this will not work out in the long run. By that I mean accidents are looming when you live with this little sleep regularly. Trust me on this before its too late to say I wish I would have slept more.
Re:Waking up at 5am to code by planetmcd on Monday January 23, 2012 @09:50AM (#3500499)
There is strong evidence that links sleep deprivation over time, even minor, to long term health problems.

As someone who cut sleep for years (6 hours was normal in twenties and much of thirties), I can attest that at some point, it becomes difficult to operate on less sleep. If all of your coping strategies involve putting in more time (essentially at the expense of sleep), when you can no longer cut the sleep, you may be in a bind when that is no longer the corner that can be cut. Though not always, that point in time often coincides with when your parental commitments are at their peek as well, and as a parent, you probably shouldn't cut that corner. So what then...

Something like the Pomodoro method helped me alot.

Or just be really rich.

Re:Waking up at 5am to code by brown9-2 on Monday January 23, 2012 @09:54AM (#3500517)
Just curious, but how much coffee is 400 mg of Caffeine? This would seem to be 2-4 regular size cups of coffee (http://www.mayoclinic.com/health/caffeine/AN01211).
Re:Waking up at 5am to code by notaddicted on Monday January 23, 2012 @11:40AM (#3500973)
Starbucks lists caffeine per drink which I think is a good universal reference point. 400mg is 20oz, i.e. a Venti, http://www.starbucks.com/menu/drinks/brewed-coffee/pikes-pla... .
Re:Waking up at 5am to code by rrohan189 on Monday January 23, 2012 @05:15AM (#3499809)
Cannot agree more. Well said.