In general, keep the lights on, don't code in the dark. High contrast between your desktop and environment is bad. Keep your eyes at least an arm's length away from your monitor.
Source: I have 20/20 vision and have been addicted to computers my whole life.
Not using computers/tablets after 8.pm and little/no use of computers during the weekends has reduced/stopped my eye strain I had developed from staring at the monitor too much.
A very simple exercise to to take something small that has writing on it like a pencil and find something else that is about 10 meters away and also has writing on it and go through the letters on the smaller object while alternating focusing on the far object between each letter. You can do this a few times, moving the small object closer to your face each time. You will feel your eyes get tired very quickly if they are out of shape.
My tool of choice http://pomodoro.trevorlandau.net/
source? I don't believe this and I'm not experiencing it after 10+ years spent heavily in front of computer screens.
Ask an ophtalmologist.