You can easily do routine work for 8+ hours daily. The sort of work that can potentially be automated one day. What you call "coding" is routine enough in my book.
But if you're doing something novel and solving hard problems, I think 4-5 hours would be a maximum for sure.
But if you're doing something novel and solving hard problems, I think 4-5 hours would be a maximum for sure.