Who has been programming the longest? How do you keep your sanity? How have you handled things mentally? What advice would you give to those of us just starting out?
Find what you love
Pick an environment or technology you love. When I started out, I worked mostly with Microsoft technologies (IIS, ASP, MS Access) and I hated it. Then I moved to another team and one the best dev there introduced me to Linux, Apache and open source technologies. I felt like I wasn’t fighting with my code as much.
Then about 10 years ago I discovered Ruby on Rails and I’ve enjoyed working with that framework ever since.
When you find something you love, it’s easier to develop an expertise.
Be open-source friendly
Think of a personal project and put it on github. Maybe you like coding for your Raspberry Pi or you have an idea for a small mobile app or a personal blog. Whatever. Put it out there.
You could also find a project you like and contribute. It doesn’t have to be time consuming. I think having an active github account is a good way to show off your skills.
Work on your people skills…
… to manage your boss/manager/other people’s expectations
I’ve been in situations where I should have sit down with my team leader/manager and express my concerns but didn’t. Learn to say no
… to build your network
It helps to know other developers and keep contacts with former co-workers. Go to meetups in your area. Show off your work, demo something (i’ve never done that myself… something I have to work on). It’s very likely the best job opportunities will come from people in your network.
And lastly… don’t jeopardize your health
I’ve worked on tough projects. I’ve work for risky startups. I’ve been in situations where I should have just walked away because of bad management. I’ve left a job on the spot once… that was not a fun experience. The thing is… because I’ve never had a big network (previous point), moving to another job has always been somewhat tricky for me.
For me personally, work-life balance is more important than salary. I’ll take less money if that means I get to work on something interesting with a flexible schedule/reasonable hours. It has not be the case lately with my current job which is why I’m on my way out.
Since your question was a bit generic, I am going to give my own perspective
I have been in 3 different tech companies at different stages of my life for the past decade.
My first job was in a big corporation, so I had a very specific role and didn’t know any better, so it was somewhat manageable to keep a work-life balance. I used sports to keep me light during the week. In the weekends, friends were always a way to shift priorities (side note: it is not part of my culture to talk about day-to-day work while with friends, not even as a conversation starter)
In contrast, my second job had all sort of madness typically found in a small company, the stress and demands got to the point I had to use prescription medication to perform. Small companies can be cruel.
I struggle to find motivation at my current job because there is some time regulation. I am planing to do freelance because I want more freedom during my day for other interests.