Having worked as a coder, I know what you mean. But those marathon sessions, however good the "flow" or "zone" is, are untenable in the long term and bad for productivity. The longer you work, whether you realize it or not, the more mistakes you'll make - which is lost productivity.