Your life isn't just your job. And your other qualities influence your career choice. Software attracts different people than law and medicine and teaching. If I had to bet, for example, I would guess that loneliness is more common among software engineers than lawyers, doctors, and teachers.