Below is from my experience. I am no expert, not a medical adviser, or anything similar.Somehow comfort for writing code, and thinking mostly, is somewhere in different dimension, outside of comfy chair.
"writing code" and "thinking" can be 2 different processes. I spend many a morning without even touching the keyboard. Just letting my brain do its work, and figure out how to best write the code.
There is that often found advice, that when you don't find the answer, then go an talk to the wall. What also may work well, is open your email and start writing down the problem, as if you want to sent the question to someone. Good chance you don't need to sent it ever. The process of putting the issue into words (including describing what is needed, what exists, ...) often gets you the answer.
That and learning design patterns, design principles, refactoring methods...
Also some space to scribble down thoughts, notes, todos. Preferences for that vary from notepad, some sticker-note-app, or old fashion paper (advantage: when the paper is full, you have a reason to sort it out / good for limiting todos)
I spent some time building a decent desk
Ergonomically, hydraulic is good, so you can spent half the time standing at your desk. But, that cost is only worth it, when you got all the other equipment right, and spent long enough hours. (And maybe even also have a risk of back problems...).
Much more important is the chair and how you sit.
- chair should swivel, so the angle of your back isn't static (and you back/leg angle should be greater 90)
- feet should touch / rest on floor (legs straight down)
- monitor must be high enough, so you don't look down all the time.
- keyboard must be at correct height (if need put some stands below the desk, to adjust it / or if the chair must go up, you need something to rest your feet on)). Check relevant pages online / make sure there is no strain on your shoulders (pushing up/ pulling down)
- Repeat: stretch / light exercise once or twice per hour...
And then
- if you need glasses, check if you will benefit from some made specially for the distance to the screen / that differs from reading glasses) / You should notice if you have troubles or not...
- 10 finger typing reduces stress for you neck (no need to look down at the keyboard) / looking down a lot, is a stress factor for the neck/spine.
- Also pitcher/bottle of water at hand (drink plenty)
My opinion: Set you screen down to maybe 70% brightness (or contrast) and use a light theme (easier for the eye to keep focus / especially with big or multi monitor, unless they are curved, but even then...). However, less screen brightness needs perfect room lightning, including dimming any sunlight so it does not cause any glare at all).
If you are used to a dark theme, it takes some time for the brain to come around. Also there are some medical conditions that benefit from dart themes.
Or better, what kind of environment helps you think and write code?
Thinks that may also help are triggers / repetitive actions.
- Have your "work only" coffee mug.
- Put your mobile on a work dedicated space (some feet away from your desk)
- turn over some picture on the wall (also may reduce distraction by it)
- find your own ...
Eventually those act as trigger for your brain.