7 Ways to Stay Motivated while Learning to Code

A couple of things you should know about me; I love a good digression and I’m a sucker for an on-point metaphor. Oh, and my sense of humour is dirtier than the veins in Lindsay Lohan’s forearms. Which I may accidentally show glimpses of during this blog post. I used to try and keep it under wraps, but now I’ve accepted that it’s gonna strike when I least expect it. Just smile and nod along.

Learning to code? Completed it, mate. Breezed through training and got my first development job straight away. It’s like learning to ride a bike, innit?

Said literally no one ever.

When you’re learning to code, it seems like one of the most difficult things on the planet. For many, it’s not only a matter of learning a new skill, it’s a process of adjusting to a completely new way of thinking and in the early stages, when the computer is throwing you error after error, you feel like you can’t do anything right. Negative thoughts begin to creep in and you’ll undoubtedly find yourself questioning whether you’re really cut out for this.

This process of transitioning to a new mindset is incredibly difficult when you’re just starting out, so here are a few steps you can take to make the ride a little easier. They worked for me and I hope they can work for you too.

1. Savour the little victories.

‘No one in the brief history of computing has ever written a piece of perfect software. It’s unlikely that you’ll be the first.’ Andy Hunt

Before you started learning to code, you may have imagined yourself to be an omnipotent coding god, sending forth your little Class and Method minions to do your bidding and bend your program to your will. You laugh and crack open a beer as you observe the fruits of your labour, a website constructed in half a morning’s work. Passing coding bootcamp will be a breeze and it’s a matter of time before you sign your first software client.

Shattering this fantasy takes a matter of minutes.

It’s four hours since you started writing and you can’t get this @#!ing first test to pass. Sweat drips down your brow and onto your shaking hands, your eyes are bloodshot and it may have been your imagination, but you thought you saw the moonlight bounce off your first ever grey hair. Your memories before you started programming are merely blurry shapes to you now. You’re 26 years old and you’re pretty sure you’re going to expire in that chair before you ever see that program finished.

You’re out of ideas, so you tentatively try deleting a colon you think looks a bit out of place. All your tests fail, the computer catches fire and you hear sirens in the distance.

All exaggeration aside, a lot of your time is going to be spent combing bugs out of yours, or someone else’s program. So when you solve a problem, celebrate! You took on the computer and came out on top! Give yourself a pat on the back, treat yourself to a 10 minute game of ping pong, a coffee, anything! You’ve earned it! Then move onto the next problem and repeat the process all over again.

2. Don’t compare yourself to others

Do you remember when you first went to the gym? I do. I was the lanky beanpole, bicep-curling a tin of beans next to the big bald bastard bench-pressing a bus. How fair do you reckon it would’ve been to stick us both in a weightlifting competition, when one of us had clearly practiced for years and the other was a complete beginner?

Obviously, it wouldn’t be. And as people’s experience levels and coding knowledge are far more difficult to gauge, you shouldn’t be trying to compete against them either.

On a personal level, my strongest subjects at school were History and English. The work content for those subjects revolved around critical thinking, debate and how things are interpreted and perceived. I then went on to study History at university. So if you think about it, the first 20 something years of my life were spent learning a completely different mindset to the one that is now required to code. My background and skills aren’t useless, they’re just not what I need right now. And that’s OK. Therefore, if I’m a little slower to learn a completely new problem-solving mindset than other people who may already have it, I’m not going to take it personally.

Some people’s brains are more naturally inclined to think like a computer, some people have come from a background that’s forced them to develop their problem-solving skills (the guy with the Automotive Engineering degree always trumps the guy with the History degree) and some people have simply practiced more. But it doesn’t matter. They’re not you. You’re you. Therefore, the only person the measure yourself against is the past version of you. If you’re a better programmer than you were yesterday, you’re doing well.

3. Remember you’re still in the early learning stages

Seems obvious, right? But you’d be surprised how often you lose track of the fact that you’re still a total novice. The more experienced guys are running marathons while you’re in the baby stage, trying to learn to stand on your own two feet.

If you’re not an avid gym-goer, think of the first time you tried something new. You picked up a guitar and expect to be the next Jimi Hendrix, but right now, you’re about the level of that bellend who cracks out Wonderwall every time an instrument is placed in their hands. You picture yourself being Cristiano Ronaldo when you first stepped on a football pitch, before your first touch hits you in the face and the opposition player, unable to believe his own luck, rolls the ball into an empty net.

Our only memories of our favourite athletes/musicians are the moments when they’ve gotten years of practice under their belts. We’re able to hear Jimi Hendrix’s genius through his recorded works or old YouTube footage, but no one ever got to see the hours spent in his bedroom, hunched over a guitar, trying to perfect his technique through gritted teeth. We see Ronaldo banging in goals for fun against whichever team has the misfortune of being put in front of him, but we never saw the hours he put in on the pitch after training, trying to improve the weaker areas of his game.

The metaphor has got to be obvious by now.

With coding, we can take the pressure off by reminding ourselves that we’re still in the early stages. It’s not that we’re inferior to those who have practiced more, we’re simply not yet at their level. We’re still in the ‘practicing in our bedroom’ stage which, as we’ve just seen, is a crucial part of making it to the top.

Being shit at something is the first step to getting good at something. Even Ronaldo had to learn this.

4. Reprogram the little voice

‘We either make ourselves miserable, or we make ourselves strong. The amount of work is the same.’ Carlos Castaneda

You know what little voice I’m talking about, don’t you? The opinionated heckler that resides in your head. The insistent little shit that relishes every opportunity to tell you that you’re stupid, that you’re not good enough, etc. It feels the need to comment on and overanalyse all of your past decisions. You barely notice it when things are going well, but when things aren’t so sunny, it crawls out of the woodwork like a cockroach. Any rough spell that you’re going through will be exacerbated beyond control when this thing takes over. Play the YouTube clip below and if it resonates with you, I don’t need to describe it anymore. Let’s call it the Negative Gremlin for now.

A 27 second depiction of the contents of my head

If left unchecked, the Negative Gremlin will slowly take over your mind, rendering you paralysed by fear and and riddled with insecurity and self-doubt. This can seriously impact your programming ability, believe me. Last time this happened to me, it took me 45 minutes to solve a coding problem that would normally have taken me about 2 seconds, had I been thinking clearly. When you’re constantly kicking the shit out of yourself in your own mind, it’s hard to get much else done.

We can’t shut out the Negative Gremlin forever, nor can we remove it and throw it away like a prom night baby. But we can retrain it.

The most important thing to remember about the Negative Gremlin, is that it’s entirely subjective. All it is, is an opinion. And opinions can be changed. Next time you’re stuck on a coding problem or grappling with a complex concept that you don’t fully understand, remind yourself that you’re a learner, not a failure. Turn that negative voice into something that will boost your confidence. For example:

‘I’m going to fail and look stupid.’ => ‘I’m going to succeed. But even if I don’t, I’ll still have improved.’

You’re the one in control of the Negative Gremlin. Not vice versa. Make it your bitch.

4.1. Recognise the impact of ‘Imposter Syndrome’

‘Impostor syndrome is a psychological pattern in which an individual doubts their accomplishments and has a persistent fear of being exposed as a “fraud”. Despite external evidence of their competence, those experiencing this phenomenon remain convinced that they are frauds, and do not deserve all they have achieved. People incorrectly attribute their success to luck, or as a result of deceiving others into thinking they are more intelligent than they perceive themselves to be.’ Wikipedia

I’ve experienced this before in the first few weeks of my masters degree and I’ve experienced it to a greater extent in the first couple of weeks of coding bootcamp. If the above extract that I shamelessly lifted from Wikipedia resonates with you, know that it’s not just you. Far from it! A review article published in the International Journal of Behavioral Science in 2011, estimated that this can affect around 70% of people! Even household names like Emma Watson and Tom Hanks have publicly said that they considered themselves frauds at some point in their careers!

My two experiences of Imposter Syndrome both have something in common. They both happened in the early stages of my learning experiences, they both last a few weeks at most and they’re both now gone. My own personal experience has taught me that this is a short-lived phenomenon and will soon pass once your brain has normalised your situation.

Imposter Syndrome is a distant cousin of the Negative Gremlin. Therefore, the same advice that applies to kicking its ass, applies here too. When you catch yourself wondering if you got to where you are by accident or luck, remind yourself that you got there by merit and merit alone. Given how strict screening processes are these days, for jobs and for coding bootcamps, the latter is far more likely to be true.

5. The power of ‘Not Yet’

When I was at school, I had a fixed mindset.

I understood most of the easier concepts I was taught and it was enough to get me Bs and Cs. The more challenging concepts that would push me to A/A* level, I avoided like the plague. In my head, they were off-limits, something reserved for the kids smarter than me. I told myself that I just didn’t have the intelligence levels to be up there with the ‘smarter’ kids and I was too stupid to handle these challenges. This view would be reinforced if I didn’t get something right the first time or when I encountered failure of any kind. It was comfortable, in a way. Convincing myself that I wasn’t born intelligent enough removed all responsibility from my hands and gave me the excuse I secretly wanted to avoid the discomfort that comes with learning more challenging concepts. Needless to say, this approach won’t get you very far when dealing with complex coding projects, or in any coding environment where you’re in a state of discomfort most of the time.

The growth mindset is the polar opposite.

The growth mindset doesn’t view difficult concepts as an all-out assault on your intelligence. It views them as a challenge, and as an opportunity to learn and get better.

The growth mindset recognises that effort makes you stronger. If you believe you can grow and improve, your brain will follow suit.

Instead of viewing failure as a matter of intelligence, or lack thereof, the growth mindset views failure as a matter of time.

Hence, the power of ‘Not Yet’.

Watch at 1.5 speed and she’ll talk at a normal person’s pace

In the study that’s outlined by Carol Dweck in the video above, instead of grading kids with a pass or fail, they graded those who failed with ‘not yet’, instead of the usual methods and got a far more positive response, in both their grades and attitude. ‘Yet’ is powerful. ‘Yet’ tells your brain that you’ll overcome this challenge in the future, instead of said challenge being beyond you. Instead of thinking that you’ve failed next time you’re stuck with a coding challenge, it’s time to tell yourself that you’re not quite there… yet. This isn’t a reminder of your lack of intelligence, it’s simply a hurdle to overcome and an opportunity to get better.

6. Remember your ‘why’

The going is going to get tough and in order to be one of the tough and indeed get going, you’re going to have to do some soul-searching and remember what inspired you to begin your programming journey in the first place. Many budding programmers leave well-paid jobs in other career paths to start a new one from scratch. Why did (do) you want to have a career in coding? What’s your why?

If you’re interested, here are some of my reasons why I started learning to code. Nick a few, if you like.

Stimulating and interesting work

I’ve worked plenty of crap jobs before I started learning to code. I’ve been a door-to-door salesman, a barman at Wetherspoons, a delivery driver for Domino’s, behind the till at WH Smith, a teacher in the arse-end of China and an intern at a FinTech bank. These jobs had something in common; they were mostly based on mind-melting, personality-destroying, braincell-killing repetition. It was easy work, but the sheer boredom was akin to torture.

Coding is a different kettle of fish. It’s challenging, it’s intellectually stimulating and there’s a degree of variety and challenge in every day. Instead of dreading the next time Monday comes around, I want to be excited at the variety of possibilities that it has in store for me. Project, not shift based work, where every project brings with it new opportunities for learning.

Freedom

After you get some experience, all you need to be a programmer is a laptop and a strong Internet connection. This opens up a world of possibilities, particularly with startups. Working entirely remotely from another country is not only possible, but actually desired in some cases. I know some tech companies that have developers working from Uganda, Argentina and Thailand and they’re perfectly happy for that to be the case, due to the time difference. When one developer leaves the office in London, another is beginning their working day in Argentina, ready to continue with the project.

Personally, I don’t like the UK or what it’s become, so the possibility of working from another country enthrals and excites me. Know any other jobs that provide you with that option? I’m all ears!

You’re valuable product

Devs are well and truly in demand, my friends. Companies all over the world have realised that they cannot carry on without employees with those skills and the British education system has been far too slow in producing enough to meet the demand, a demand which is only going to increase in our computer-focused future. For you, this opens up a lot of opportunities. You can go from a junior developer to senior far quicker than in other professions, you can go freelance or you can start your own business fairly easily. You have scarcity power and your career is in your hands as a result.

7. Keep doing other stuff too

I thought this was a pretty important point to factor in and I’m doing so because I thought of it about 2 seconds before I was about to hit the ‘Publish’ button. I had to re-edit this entire blog post to fit it in, that’s how important I reckon it is!

For some, the temptation to be in front of your screen for 12 hours a day is pretty tempting. Any time spent not doing coding seems like a waste. In my opinion, this is thewrong way to be going about it. Taking some time to engage in other hobbies is great for your mental and physical health, as well as keeping your morale high, sanity intact and burnout distant.

You’ve probably guessed by now that my hobbies are boxing, football and weightlifting. I think these are great activities to engage in for a programmer for the following reasons:

They use a different side of your brain to coding. You spend less time thinking and more time acting and reacting instinctively. This gives the analytical side of your brain a rest and the instinctive side a chance to roam free.

They’re wonderfully simple. The complexity of multi-file projects, dependencies, variables, if statements et al. are all put to the wayside in favour of far more simple goals. Lift that weight from A to B. Put the ball in the net. Don’t get punched in the face. Simple stuff and beautifully therapeutic.

They get the blood flowing. Your brain needs a steady flow of oxygen and doing intense physical activity provides that in spades. There’s been several occasions where my mind has been fried to the point where basic human functions were beyond me. Having a conversation with me in this vegetated state will only return you grunts and single-syllable answers. A quick game of 5-a-side rejuvenated my mind and I felt fired up and ready to take on the next coding project. And I did. Very quickly.

I’ll shut up now

To recap in case you’ve forgotten, or if you scrolled down to the bottom without reading it, here are my ways to stay motivated while learning to code:

Savour the little victories

Don’t compare yourself to others

Remember you’re still in the early learning stages

Reprogram the little voice

Recognise the impact of ‘Imposter Syndrome’

The power of ‘Not Yet’

Remember your ‘why’

Keep doing other stuff too

Thanks for making it to the end. Anything you found helpful? Think I’m full of shit? Let us know in the comments either way!

This story is published in The Startup, Medium’s largest entrepreneurship publication followed by + 379,528 people.