Question: Why do most programmers/developers use a dark theme while writing software/code?

Answer: Because light attracts bugs.

@nixCraft

Easier on the eyes...

Prolongs the life of your LED screen, particularly if it's OLED.
@ferricoxide @nixCraft
Only if you have perfect eyesight, if you have imperfect eyesight dark on light is better, that's why opticians use dark on light background.