Ask HN: How to get back hacker's mentality and joy of coding

107 points by epimetheus2 ↗ HN
I've been coding since I was 11-12 years and I can remember the incredible amount of hours I was able to put in just because I was completely zoned out by the fascination of coding.

Now I'm 30 and I grew to be, at least according to market, capable (scala/backend) software engineer, but I no longer take any joy in coding. It's been around 12 years I've been coding professioanly (I had my first part time job at 15), and I can build a variety of interesting things.

My biggest problem is I can't find motivation and focus to do it. I don't enjoy work, and I'd like to WANT to build new things, just like when I was 12, but I just don't care anymore. I pretty much count down hours when I don't need to code (when does my job finish). When I finally manage to overcome exceptional effort and start coding something of my own, it's usually a lot of fun, and there are some sparkles of fun, but it never turns into fully fledged flame that I used to have.

And the next day it's the same again. For the most days I just can't overcome the lazyness to do something useful with my skills. I have balanced life, even considering corona, but overall I would just like to be fascinated by tech as I used to be, and toying with it would be something that I'd look forward to and take as a relaxation instead of something that saps the last pieces of energy that I have from work. I used to be like that, but last few years (5+) it's no more.

Any tips on how to perhpas change perspetcive, habits, or what to read, so I can enjoy the skillset that I had developed over the years rather than feel miserable?

128 comments

[ 6.6 ms ] story [ 216 ms ] thread
I am in a similar situation (17+ years as developer) and I recently found joy in ethical hacking. I feel like a young kid again discovering new things on a daily basis after work.
I'm this way with side projects, but I can only put in the time because I'm young without the responsibility of running a family.

If you're in a position to, maybe just take some time off and find something you're particularly passionate about. For me, it's making video games (with an educational slant to be more meaningful and put less pressure on a hobby becoming a second programming job).

Hi. Same here.

I can recommend some book or just write down some pep talk here which is gonna feel good for both of us but perhaps not useful.

The thing I want to ask is about your mental health. Maybe these things you mentioned are part of some mental health crisis you're experiencing that needs caring. Not enjoying the past enjoyable activities is not a simple thing to ignore it.

If you could write it down I'd be very grateful and go through it all.

Thank you for your consideration. My mental state is pretty ok I think, I'm overall cheerful person, it's just that I'd like there to be more meaning than work.

It's been gradual decline in joy.

Oh man, I'm in the exact same spot right now. I'm 35, sold first website when I was 17. And I don't even have "regular" job now, just working on my own projects and I still completely dread starting to work every single day. Sometimes it takes around 6 hours for me to just get started and write a line of code. Only to stop an hour later because I'm exhausted from doing nothing.

The only time I am able to regain that "in the zone" feeling from 15 years ago is when I try some completely new stack/framework/language on a fresh project. The problem is I can't do that all the time because I've started dozens of projects and wasted years without finishing anything.

I will be monitoring this thread for any help. This is a serious problem for me.

I'm a bit past the try-new-stack. I have a stack that I'm very productive and happy. I feel like I've finally found what I love to use, am capable of using with huge productivity, but don't feel like using :-)
Get tested for ADHD if you haven't already. Most people think ADHD means hyperactive children but its more an attention disorder where it can be very difficult to get things done if they don't actually interest you or there aren't severe consequences like failing a subject. I've felt the same as you, and it was a 'wow' moment when I started reading about ADHD and people's experiences who were diagnosed as adults.

If you have ADHD there is a rich set of literature on managing it, supplements to investigate (lots of discussions in the nootropic community) and the meds can be a life changing tool when used responsibly.

what is the test?
You can get a referral to a psychiatrist from a doctor who will get you to fill a number of multi choice forms and look at your past school reports to form a diagnosis. This may be more or less involved depending on which country you live in, some places irresponsibly hand out adderall like candy.

IMHO the best approach if you suspect you may have ADHD is to do a lot of googling for adult ADHD, there are good videos on youtube, discussions on reddit and various forums. If you still think this might apply to you, then search for ADHD test.

Thanks - pretty sure there is no ADHD test in my country
Whenever someone expresses this, I think about Feynman talking about burnout. There was actually a post about it on HN! https://news.ycombinator.com/item?id=3874875

Beyond that, I’ll offer as a 40 year old who’s been there...find people to help. Finding people who need help is always the way to working on things that feel interesting.

very interesting. I had no idea Feynman felt this way.
Do the things that doesn't matter
Two questions:

1. Are you mentoring anyone?

2. Are you growing your knowledge? Languages, algorithms, protocols, domains all beckon.

Not OP. I helped a couple friends get into programming and it certainly helped me gain a new perspective, value my skills, and motivated me. So I would give that a try.
1) nope 2) yes, some people from my close proximity say that I learn too much. I feel like I only learn whereas I should be building something. My whole career has been constant nonstop learning and improving
One of the things I've learned over 30 years developing is that the application building technology skillset required changes every 5 or 10 years (except from a few niches), make sure you are learning about new (and old) technologies around the things you use at work.

It can also be the place where you work - the type of applications (working on something you believe in or is fun is a real motivator), or just the style of the company and management. As you can enjoy coding something on your own, perhaps a new start is called for?

Finally perhaps you've exhausted your love for coding and its time to try something else - project management, design, or something new entirely.

Hi epimetheus2! There are probably going to be a few people here who say, "code in the morning, spend your time and mental energy on yourself before you spend it on your company". I agree with this, but I also want to point out a few things I've found for myself, since I'm coming from a similar background as you.

First, part of the thrill of coding when I was a kid was the discovering and learning new things. Even making my name flash on a screen was a really cool thing. At the time, coding felt like a mystic art that you had to master through hours of trial and error, and each thing you learned was another building block on your way to understanding.

Now that you're doing this for a job, you know how the sausage is made. You no longer are coding either elementary things (to learn whichever language), or even building things you find an interest in. You're using your skills for the purpose of making a company money (which hopefully pays you well enough to make up for the fact it's draining your own enthusiasm for this craft).

And that's probably one of the biggest things. You're taking this previously magical thing that you used to discover new and exciting ways to build [what you wanted] and using it for very mundane things, or for uses that you just have no passion about. Also, there are a million articles or Stack Overflow questions that tell you step by step what to do. You no longer have one old book from the library and 3 outdated Web sites that kind of talk about what you want to know. The excitement of discovery is lost since all of the answers are flashing on a bill board for you and everyone else.

I was feeling the same way as you from about 1 year ago until just 1 month ago. I also work as doing code (JVM stack and backend, as well). I also have about 3 projects of my own that I alternate between (1 backend, 1 frontend, and 1 that is both). About a year ago (Pandemic time) we laid off quite a few people, which meant all of my energy had to go into picking up a larger workload–effectively killing my motivation and passion for my projects.

Taking a year long break from my passion and projects was a very good thing. You shouldn't have to feel that you "need" to code for joy. That'd just kill the joy. Instead, find something that brings back that feeling of newness and magical curiosity that coding did when you were a child. Something that nobody is telling you what to do, or how to use your abilities.

Take up painting, photography, bike riding, wood crafting, a Raspberry Pi or other hardware (although, let's be honest, there are probably a lot of us who just buy them and leave them in a drawer :)). Even learning how to tend a flower garden would be something that you can pour energy into and feel invigorated when you get the results.

In time, your thirst for creating your own thing with code will come back (it did for me, anyway). And in the mean time, you can feel reinvigorated seeing the benefits of your work come to fruition, and have new knowledge that you can share with other people, or just enjoy thinking about as you go about your day problem solving how to solve your next curiosity.

Good luck! Life should be fun. You don't need to be the "coding as a hobby" person all the time! Feel free to jump around and only enjoy the things that bring you joy when they do that for you :)

If you are coding in work for 8 hours, not being in mood for the same thing after that is normal and even healthy. Do something else to recharge - sport, reading, learning, watching shows, art, music, socializing. Engage in things you don't do at work.

If you are demotivated at work, try to change job. Sometimes changing environment is needed, some teams/places are fundamentally demotivating.

Think about your values and compare those with the target of your current projects. If there's a hefty dissonance between those that can be a problem for many.

I felt unenthusiastic working with F2P mobile games and ended up in special education. Pay is somewhat less but the meaning was reintroduced to my life. And its a huge difference for me at least. I'm not a f/t dev so can't emphasize that side but the meaning is a gigantic thing for most of us.

Find something worth doing with absolutely no viable or intentional financial benefits. It may have been done a thousand times before, it may be so utterly silly you wouldn't think twice about it and it may be the biggest "what if" of your career. Just do something worth doing, because you care about it.
I'll be brutally honest - I'm very tied financially to large paychecks that I can earn with Scala :-(
Consider your long-term financial strategy.

Short version: google "early retirement".

Long version: Even if you make lot of money, consider spending little, and saving as much as possible. Doing this will increase your freedom in the future. You may be able to choose a different, less paying but more enjoyable job. You might even be able to completely retire, and get extra 8 hours a day!

A part of this is knowing how to invest money. There are many scams out there, you need to do some research, but the good start is looking for passively managed index funds ("index funds" = copy the economy, which is generally growing; "passively managed" = you are not spending half of your interest to pay someone to roll the dice). Dunno, you might put 90% of your savings in these, and 10% in crypto. Maybe buy some real estate. The important thing is to invest money and avoid scams. Then watch your savings grow exponentially.

Many people with high income get caught in the trap of increasing their spending accordingly. Sometimes the extra spending provides significant extra pleasure, but often the benefits are negligible and people waste money simply "because they can" and because everyone around them is doing the same thing so it would be "weird" not to. Sometimes reducing your expense gives you as much extra money as having a side job, and is incomparably easier and more enjoyable (cooking your own meals may feel low-status, but you are your own boss, there are no meetings, no Jira tickets, no need to compete with anyone).

If you don't have kids, as a software developer you should be able to save at least 50% of your salary. (Maybe more if you say the Scala paychecks are especially large.) Think about it this way: if you save 50% of your salary, it means that for every year you work, you get 1 year of vacation... maybe more, if your money collects interest. And if you feel burned out now, it's probably not going to get better in 10 or 20 years. In theory, if you can save 25× your yearly expense, and invest with 4% interest (above inflation) on average, the money will last forever. Note that you can still keep working, even if you no longer have to, and you will have greater freedom at job choice, so probably more enjoyable jobs.

You are missing agency.

May try a retro computing project. Restore you old PC, code something in basic languages, on a very low powered machine. Exclude any potential revenue ideas from what you are doing.

Agency, exactly. In my previous job I was at the bottom of the food chain, just doing tickets, with no real sense of agency or care for the project as a whole. I worked my daily hours and rarely a second past.

I found a new job where my responsibilities are now “build everything from scratch because we have literally nothing”, and it’s so empowering to feel that my creative and technical skills are being valued. Consequently I’m way more invested now than I ever was before.

The last sentence hit home, thank you. I get huge motivation boost whenever anyone uses anything I make (even if it's single person). So perhaps aiming towards anything that excludes revenue is the way to go. It's a bit difficult because I'm maybe overly focused on money/paycheck. But your comment to "exclude revenue" hits home.
There are things you enjoy, and there are things you get paid for, but if you try to do both at the same time sometimes the result is a compromise that is neither paid well nor enjoyable.

(The converse problem is that if you keep your hobby and job separate, it takes more time. And you need some extra time for dating/family, friends, sport, etc.)

Learn Clojure if you haven't already. It will bring joy to your programming skills.
sorry I tried, I'm too in love with Scala :-) even so much that I feel so unproductive in anything else that I'm almost frustrated
Radically switch programming language and paradigm.
When this starts to happen to me, I try to take a step back and focus more on my dating/personal life for a bit. After a few shitty dates, coding wont seem so bad any more =P
I have amazing GF and do martial arts and overall love my life but deep down I feel there's that passion lacking when it comes to coding
Probably because you have an Amazing GF that makes the things you used to love seem mundane in comparison. I'm also around 30 and occasionally feel burnout and the lack of interest as well. I like to do DIY projects because such as home automatic projects to add fuel and motivation
I was in a very similar position. After digging I to that feeling with my therapist, I found out that I wasn't miserable coding. I was miserable with all the other bullshit I've had at my job: stand-ups, task tracking, constant meetings, always feeling pressure and responsibility that triggered impostors syndrome, and so on.

I've changed companies, and now I don't have any of that. I don't even remember how my bosses voice sounds: it's a remote position where we communicate in text, mostly asynchronously. There's no task tracking, just company chat. I almost never get asked when will I complete something; we just discuss what needs to be done, and then I do it. If I don't feel like working, I don't. Nobody's tracking my time. And later, when I get internal motivation, I put in 20 hours of uninterrupted, productive work.

I don't think that I've ever been that happy coding in my entire life.

I can relate to this. Also started coding young and I'm 32 and a Scala developer.

Here is what I stated doing recently and feels like it helps:

1. 15 minutes mediation daily before work starts and 15 minutes after work. This marks the end of a work day and can start thinking about something else.

Lately due to some changes in the company I found myself thinking a lot about work even after working hours. Without being able to stop. Meditation trains my mind to calm down and switch off.

I also feel that I can now switch tasks easier. And my mind feels lighter.

2. Try to reduce the bad stress at work. Refuse nonsense deadlines.

3. 1 cup of coffee per day is enough. Move your body with 30 minutes of running and daily walks.

With the remote working we now have plenty of time. So 15 minutes of meditation across the day is really easy to integrate.

Thank you for tips. I don't think I can live with only one cup of coffee though :D
From reading quiet a bit on this the biggest problem is quiet often is only doing things you feel you should be doing.

Our brains need rewards to to be able to motivate us to do hard things.

When you only do the things you feel you should with nothing fun. You effectively are doing the same as punishing yourself every-time you are doing the thing you want to be motivated about.

Eventually your brain will start to fight to not do it.

The trick to get it back is apparently to start finding small things that are fun and easy and to do some unrelated external things to also just give your brain some time off.

Basically you want to follow similar patterns as if you are training an animal

By doing the small things that give you a treat. You are training your brain to want to do more of it.

You also need to spend some time on external things to work. That way the times when you have to work on things that are not rewarding you have something else to counter balance this.

This should not be something computer related if possible.

Also if it can be something where you get more human contact it’s recommended.

I’m talking as someone who is slowly recovering from this as well.

Still lots of work to go

But it definitely does improve. Just takes time.

This actually makes so much sense to me.

I think i have developed a set of actions, unconsciously, to balance work/fun and rewarding my self.

Whenever i start a new project my gym/workout routine also grows otherwise i feel unmotivated.

Competitive gaming is another reward. It's something i can do every day for 30-40 minutes, feels rewarding, and stabilises my mood.

(comment deleted)
If you like talking to your colleagues, you may want to start every day with a 10 minutes chat. If you like seeing unit tests pass, you may want to do test-driven development. Heck, even making money could be made a bit more fun, if you paint a large chart of your current wealth on your wall and update it every month (the key is doing this every month, rather than once a year).
It seems like it's important to you that you find coding fun, so it's disappointing that you're not motivated to dig into your work.

I think if you're in a situation where you can comfortably accomplish the work tasks without having to learn anything, and you have to do this reliably, then of course that's going to be boring. - The same state as "nearly finished" the other side project in the CommitStrip comic https://www.commitstrip.com/en/2014/11/25/west-side-project-...

I think a lot of the fun I had when I first start coding was it's very easy to be curious about things, and to chase that curiousity. - One model I've heard for "motivated at work" is it's a combination of autonomy, building mastery, and a purpose/sense of belonging. (Many of the other comments suggest increasing some aspect of one of these). I'd say tech isn't inherently interesting; especially not if you have a pretty good understanding for how some technology works.

I think you're burnt out. Seriously think about a break from the industry.

I did and the joy is back.

I did that, and the joy was back. Then I ran out of money. Then I started coding again, made some money, but burned out again. Now I am considering taking a break again...

Maybe there is some healthy balance, like taking 1 year off after each software project. (By "1 year off" I don't mean vacation, but simply taking another - probably much less paid - job.) But it causes some questions at job interviews.

I have a job with mixed responsibility's. One month I'm coding, the next I'm setting up CNC machines to run new products. It works well for me. The pay is good and the work varies. I'm lucky to have found a balance but there could be a position out there that suits you better than coding day in, day out.

Then there is the dream of living like this guy https://www.expatsoftware.com/Articles/guy-on-the-beach-with...

Might be age. At some point most people stop fully enjoying things. I remember liking music to the point of learning all the lyrics to thousands of songs, liking movies to the point of knowing all the published dates and actors. At some point it just stopped being that interesting. I still know the lyrics but I rarely learn new ones.

Coding for me generated a feeling of maximal accomplishment. After completing a hard coding puzzle from TAOCP or any personal itch I’d be able to sleep immediately or get an even stronger uncontrolled stream of inspiration but now it happens maybe once in a few years. (I’m 30 too)

I fear this very, very much. What if I never can regain that passion? I feel like junkie who never can get another high.
I am someone who cycles through passions. I used to feel terrible that I wasn’t able to stick with anything. Now, I’ve come to terms with that being who I am. I’ll love something, drop it two weeks later, pick it back up 3 months from now. The way I look at it is it’s my leisure time, and I get really stuck/dissatisfied with life when I feel like my side hobbies are jobs that I should be doing. I am jealous of my friends who find something they enjoy then obsess over it. I just can’t do it. I’ll read 3/4 books at the same time.

I guess what I’m trying to say is, passion doesn’t have to be one note. Passion has ebbs and flows, but there is always something out there waiting for you.

I think it is not the age per se, but rather the lifestyle changes that usually come with age.

How many responsibilities are you keeping on your mind? It used to be "school", which is relatively simple: you do the lessons and maybe homework, and spend 2 days before the exam learning. There is a lot of free time and attention to explore and learn new things. Also, the school automatically provides a social environment of people facing the same problems as you do; but at the same time, many of them are willing to discuss school-unrelated topics with you.

Now "work" is more complicated, because on one hand you need to do the work you are assigned, but at the same time you also need to make long-term decisions about your career. (It is possible to get into a blind alley by doing whatever the company needs from you... only to find out one day that your current project is finished, and your knowledge is obsolete, because you focused too much on finishing the old project which used old technologies, and didn't pay enough attention to learn the new ones. Oh my, this may actually look pretty bad on your CV.) You have fewer colleagues than you had classmates, and most of them are probably working on other projects. Most of your colleagues are probably not interested in your work-unrelated interests. But you have fewer time to socialize with people who are not your colleagues.

When you have kids, this introduces a new set of duties: how to feed them, how to play with them, the choice of kindergarten and school, etc. Even less free time.

The problem is that when you find some interesting thing, it becomes more difficult, sometimes completely impossible, to dedicate some time to think only about that thing and nothing else. At school, you can spend half of your weekdays and full weekends doing whatever you want. With job, it becomes evening when you are tired, plus weekends. With kids, it's maybe 30 minutes every night after the kids are sleeping, and no time during weekend; it depends on your situation, what kind of babysitting is available, etc. Of course it is harder to get enthusiastic about something that you barely have any time to do, and definitely no long uninterrupted blocks of time.

It's not just that duties take away your time, but also the fact that they are present in the background of your mind even when you are not actively working on them. It's always the "shouldn't I be doing X instead?" or "only 30 minutes left, then I have to turn this off and do X instead". That distracts and takes away the joy.

Build a loudspeaker kit. There is a bit of electronics, some woodworking and an immediate pleasure once you create a physical object yourself.
For me the joy of programming is a direct consequence of the solution I deliver. That’s it.

This means I tend to focus on product and human efficiency. When I am not being efficient I am focused instead on refactoring because the simplicity provide to one area opens scale in a way I would not have previously considered.

The anti-thesis here is unnecessary pageantry. It’s all the bullshit other developers need to make things easier, such as excess tools, frameworks, decorations, process nonsense, and so forth. These things distract from solution delivery, waste time, and increase required investment.

I find it motivating to create tools that help coworkers. Something satisfying about the direct feedback, vs a faceless customer.

Creating things for myself alone no longer has much excitement, or only brief bursts of excitement. It used to, like OP notes.

There is a metric to that line of thought. The further away from the self, and thus programming generally, the audience becomes the more exciting and challenging the product becomes to write.
Have been and to a certain extent still am in this situation. Started coding at 7 on a zx spectrum. Nothing fancy just moving dots on a screen (still remember inkey$). Wrote my first interpreted language in highshcool. Worked as a developer, architect, manager, head of development but i felt like i lost my passion.

Then i switched to something radically different from my daily job. Looked deep into my early hacking days and i remembered how i enjoyed writing games (at that time a bit with directx and dark basic - heck i was loving it).

Recently, I started diving into 3d game dev, 3D modelling and texturing. If you enjoy hacking things then i think this is it, at least for me. I find that everything around game dev is a creative hack - including visuals and game mechanics. Bought a kick ass game dev machine, vr, consoles, loads of books and frankly, i cant wait to get back into the zone as soon as i am done with my client work. I just love it. The other day i wrote a generic way to interact with virtual lcd screens, code to wire electrical cables and i am considering implementing a virtual scripting language (so players can “program” in game devices and their interaction). Sometimes i spend weeks figuring out how to solve a problem. I hope to turn this into a commercial success but if doesn't then at least i’m enjoying the ride.

So my advice is maybe look into your past at something you loved doing, maybe totally different from your daily job, and pick up from where you left. That past self is still there just needs stimulating i think.

Look for a new job.

There's a lot of comments here about focusing on yourself with meditation or hobbies or whatever. But that's just ways to survive a job you don't care about. It's a workaround.

If you spend all day training your brain to hate programming your brain will learn to hate programming. You need to change jobs. And then you will have to spend at least a year to slowly restore your brain to a working state.

It took me ~two years.

Now I'm excited about programming and has been for 8 years solid. Changed jobs again recently to keep that fire burning. There is no substitute for your job being meaningful.

Sadly I just started new one with thought it will be better (it is, but only slightly)
> But that's just ways to survive a job you don't care about

And what to do when you couldn’t possibly care about any job that would hire you?

> And what to do when you couldn’t possibly care about any job that would hire you?

meditation, hobbies and whatever