That's funny because it's the opposite for me-I work well when it's a bit dark. In fact, when I did Math (which didn't require constant visual feedback), I would do my best work by while keeping my eyes closed for long periods of time.
Side note: do write code not like this, please.