I would agree that often studying through a night may not be beneficial, but occasionally in large programming projects, sometimes it has to be done. Especially when working in a group, and on that note, I haven't found that my ability to code diminishes w/ lack of sleep (as long as I stay energized). Yet, verily you ask what would demand this sort of suffering... I'll give an example. I was working in a class on Computer Architecture, (taught by Dave Patterson for those in the know) where the class was split into 5 groups of 5 and we had 13 wks to design and build a cpu on an FPGA. When the final checkoffs neared, my group (along with several others) lived on the lab for a week and a half, forsaking all other classes and working probably about 18 hrs a day (I swear its not a fucking exaggeration). We would break to eat, usually sleep in the lab, and occasionally retreat home for a few hours of sleep before returning to the Hell that had become our all encompassing objective to finish the project. By the end of about seven straight days of this the lab took on quite a party like atmosphere and everyone retained the ability to code their particular part, but not really do anything else usefull.