Optimizing for happiness is very good advice for beginners. The failure mode for beginners is to get overwhelmed, discouraged, and then give up. So it makes sense to pay more attention to how happy a particular programming environment makes you, and worry less about how marketable it is.