This is a great article and should be a must read for anyone who managers coders but is not one himself. The TL;DR is that money and work environment are great, but the programming work itself must be challenging and useful (as in, actually used by someone) in order to be motivating. Lacking that, programming is awful.