However, I agree to some extent. I'm especially opposed to the concept that there should be 8 productive hours in a day. I sincerely believe that this is for most people not possible in creative knowledge work, which includes software engineering. So, if you have 5 productive hours of engineering and finished your goal and are in line with expectations, there shouldn't be a need to drain yourself to keep going, but rather spending your extra time on something else like job-related learning is a great way to prevent mental fatigue.
This is especially true as there can be very different "energy distribution" between people. One person can achieve in 4 productive hours what another can in 8. But one works in productive bursts and the other in sustained effort. The first can't just sustain or expand that burst to 8 hours.