Why do you think they have a pessimistic attitude?
I´ll use myself as an example.
I started coding professionally at 23 (I´m 43). For years I pushed myself to be the best coder I could. At 35 I got laid-off. After that I just got sucky jobs were I´m treated like they have me there as a favor (and I work with the latest, and I´m, even with the pessimism, a top performer).
A coworker of mine that thought that coding was a losers job, coded for some months and went to work as a B.A and later as a PM, nowadays is an engineering manager which earns way more than me and is treated way way better. His whole programming experience is an 8-month part time stint with Winforms. And sadly he is not the exception...
With all due respect, there is no reason to have had sucky jobs over the last 8 years. The market has only gotten increasingly hotter... if you're in a tight spot career-wise, do the work to get into a better company working w/ better people.
If it's an issue w/ passing interviews at better companies, interviewing unto itself is a skill that should be regularly honed.
When I was a younger engineer I was stuck in a job that was unsatisfying for about 5 years... every 1.5 years or so I would interview w/ 3-5 positions, usually one or two would be close to an offer but I ended up empty-handed, would get deflated and give up.
Over the last decade I've taken the job search much more seriously, usually interviewing at 15-20 companies so I can end up w/ 3-5 offers to choose from. Yes, it's very time consuming (probably some 60-70 hours of my time over 5-6 weeks), but the quality of the companies I've worked at has been consequently more satisfying.
I´ll use myself as an example.
I started coding professionally at 23 (I´m 43). For years I pushed myself to be the best coder I could. At 35 I got laid-off. After that I just got sucky jobs were I´m treated like they have me there as a favor (and I work with the latest, and I´m, even with the pessimism, a top performer).
A coworker of mine that thought that coding was a losers job, coded for some months and went to work as a B.A and later as a PM, nowadays is an engineering manager which earns way more than me and is treated way way better. His whole programming experience is an 8-month part time stint with Winforms. And sadly he is not the exception...
In most places devs are being had.