I hate it when coding is seen as this herculean task that apparently demands near superhuman focus and physical/mental stamina. It doesn't have to be that way. You can customize your environment to be as frictionless as possible and bang out good code without trying super hard.
The key is customization and passionate, opinionated environments (both physically and virtually, i.e; ergonomic keyboards, chairs, etc, alongside a text editor that fits your coding style, and rapid viewing of what your changes have actually done, no more coding in a black box).