On the other hand I can't think of anyone I know in our industry who is not depressed and/or pissed off all the time and doesn't do this job just because it pays well and is comfortable. The typical image of a software dev I have is a 30+ grumpy white dude who isn't taking care of himself and is strongly opinionated about whatever he does while hiding how depressed and bored he is.
I've worked in quite a few places big and small and barely if anyone is going to conferences, admiring other programmers, is in communities that admire each others' work and is genuinely passionate about software. Maybe the AI/ML guys seem to be more into what they do than the average dev but that's as far as it goes.
Since I moved to the (solo) entrepreneurship track I'm way more happy. At first it doesn't pay so you need to have savings, but after some time (depends on the person) you start making a living and you decide what to work on.
Today, half of my time is dedicated to writing software that I genuinely believe have a positive impact on the world (https://github.com/skerkour/bloom), and half of my time is dedicated to writing and sharing (I'm writing a book).
The best thing that I've understood is that even if my primary skills are programming and security related stuff, it doesn't mean I have to code for a living. There are a lot of jobs related to programming that you can switch to.
As a side note, I would add that programming is way too much undervalued in most companies. Programming is very demanding physically and mentally, and if you spend 6hours+ on a chair in front of a screen, you should take a few steps back, and start exercising and leaving the screen a little bit more.