Original question from Quora:

Is being a programmer depressing?

My Answer:

I find that being a programmer can be a truly wonderful thing and it is in no way depressing whatsoever.

However, that is just me and I can imagine a scenario where being a programmer would be very depressing. Of course, you have to understand why people get depressed in the first place.

Disclaimer: I am no doctor. This is not medical advice. It is a combination of me paying attention to the mental states of those around me and observation from my own personal experiences.

So, to be clear your mental state is no accident. In fact, it’s largely a chemical process so if you feel happy it’s because you have happy chemicals in your brain making you feel happy. If you feel sad, you have sad chemicals in your brain making you feel sad.

As near as I can tell, people are not intrinsically happy or sad on their own. Look at children around age one or younger where they have relatively little enviornmental conditioning training them to act a certain way and they are usually happy so long as their needs are met.

Most adults are generally the same. People are pretty happy when their needs are met.

The most basic needs we have as humans are food, shelter, sleep, sex, work, love, companionship, and movement/exercise.

If you take something like Maslow’s heierarchy of needs there are “higher level” needs like achievement and so on, but usually unhappy/depressed people are messing up the basics on some level from what I can tell.

So, when people are unhappy, it’s probably most often an issue of improper amounts of food, sleep, sex, love, or exercise/movement. In modern times the majority of people aren’t struggling to find shelter or useful work most of the time.

What I can tell, the people who struggle the most are the ones with a combination of factors working against them and usually it’s the wrong combination of food, sleep, sex, and exercise.

Food, sleep, and exercise all contribute to the most important metric to manage in your life - your energy. Most people eat too much, sleep too little, and don’t exercise at all.

A better alternative for most people would be 7-8 hours of sleep a night, a diet of mostly meat and green vegetables, and some form of exercise/movement every day with 3-4 times a week doing something strenuous like weight lifting, interval training, CrossFit, etc.

The people that get those things right seem to be less often depressed/unhappy.

And on the point of sex, it seems that many men have a need for sex at least 1-2 times a week (every 3-7 days) and when that need isn’t met the other areas that impact your energy levels like sleep, food, exercise get messed up. So, as a guy, put yourself in a relationship where sex is a regular, frequent occurance. (Yes women need sex too, but I’m a guy so I’m not speaking for women in this context)

If you get those things right, the odds of you being depressed go down outside of genuine clininical depression.

Now, what does this have to do with being a programmer?

Well…

The default behavior of many programmers is to sit at a computer all day long, move as little as possible, stay up too late staring at a screen to write more code, and generally ignore the basic needs they have - food, sleep, exercise, and sex.

And if you live that way, it is very easy to find yourself depressed as a computer programmer, even if you are very successful in your career. I’ve personally had times where I let myself work too much on code and not enough on food, sleep, exercise and I find myself completely miserable.

Luckily, since these are such basic needs, it isn’t particularly difficult to figure out food, sleep, exercise, and sex. There are some 7 billion people on the planet right now who have figured it out (mostly), and billions of people who came before us who also figured out these basic things of life.

And here’s the cool part. If you get food, sleep, and exercise right, the other needs you have like sex, career success, love, companionship, and so on are often easier to obtain.

Truly, it is a matter of focus and probably the biggest improvement I’ve made to my life as a programmer and human being in the last year is to focus on my energy levels and make sure I’m getting proper sleep, food, and exercise.

Get those three things right and every thing else is a whole lot easier!

-Brian

P.S. Have you subscribed to Code Career Genius yet?