In good condition I exactly say like jos82.
When in pain (I have a back neck pain killing me since 2 weeks and it seems related to my working position) It is unsustainbale to focus even on other tasks than programming for more than 5 hours a day and sometimes less (like 3).
When going into burn-in (like mbenjaminsmith, or Daishiman) I can focus up to 8-10h+ a day, the problem is the burn-out: Months with reduced concentration and almost a negative productivity in quality and quantity some days.
When in good physical and psychological condition, I focus the same amount of time, but quality of code is way better.
At home, the lack of noise and unwanted interruption increases the capacity of concentration and I can code 6 hours with better quality. The lack of social interaction however on a long run however erodes my pleasure of working, so I don't do it too often. (but it should also happen in good working environment or with good mental Daishiman or walshemj).
Stresses debilitates me, so I code way slower and with poor quality during a crunch unless I kick a burn in.
That is the reason I prefer a balanced solution.
It is kind of funny we have the same feedbacks.
I have a theory that the difference between 4-5 and 5-6 is the difference between a crowdy working environment and a quiet one.
Could some of you tell whether you work in a crowded or a calm place too? It would be fun if I was right.