But if number of working hours is significantly lower than 40 hours per week, then productivity deteriorates too, for the following reasons:
1) In order to solve complex task, programmer need to load all relevant details into his mind. That takes time. If working day is too short, then most of the time is spend on such loading and there is not enough time to actually accomplish something.
2) Shorter working hours usually means less expertise long term. Less expertise means less productivity.
3) Shorter work time means it's harder to meet with coworkers, because there is not enough work hours to meet. Less meetings with coworkers means lower productivity, because work in isolation usually mean working on wrong problems and less knowledge exchange.
So, on one side we have burnout risks. On another size we have incompetence risks.
Our society tried various working schedule and worked out 40 hours work week as the one that is closest to the optimum.
Note though, that 40 hours work week does not mean 40 hours per week coding. There are many other things that developer should do at work.