While I get what you are trying to say, but this is not always true. There have been times where I pulled up all nighter and produced good work, specially during college or some project I am deeply invested in. But similar thing can't be achieved in a big org though. If I am expected to work for more than 5-6 hours a day to meet deadline in the office, the quality of work invariably declines.
John Carmack also defended working long hours, and admittedly he is one of the most productive developer.