DEV Community

Cover image for How to learn coding in an efficient way
Life.Tech.Psych
Life.Tech.Psych

Posted on • Originally published at lifetechpsych.com

How to learn coding in an efficient way

What’s your idea of learning to code?

Whip out your computer, type out a couple of cool commands. And bam - beauty personified.

Sorry, nope.

The process is at least 50% struggling especially at the beginning.

And that’s how it should be.

love-to-learn.jpg
    Photo by Tim Mossholder on Unsplash

I’ve seen people quit programming because they don’t want to struggle with bugs. That’s like hating the gym because you don’t want workouts to hurt.

Learn to see the struggle as the way.

You don’t run from bugs; you train yourself to find them quicker.

A proficient programmer is an efficient detective of bugs.

If you’re feeling frustrated that things are not smooth, remember that this is how learning actually works.

Neuroscience research confirms that practice doesn’t simply make you perfect; it is deliberate practice to improve in a specific task that makes you better. And deliberate practice involves struggling.

So your mantra should be:

  • You code.
  • You debug.
  • You struggle.
  • You overcome.
  • And you repeat.

If you’ve not struggled at all, you’re simply playing around.

If you struggle all the time, then the next section is for you.

You’re not dumb, you’re learning at the wrong level.

Let’s start with a little analogy.

Imagine learning the English language (the language of exceptions).

You start with a tutorial motivating you to learn to spell big words like ELEPHANT.

But it’s not working. After beating yourself for so long you decide to go to a lower tutorial and learn to spell smaller words like ANT.

But you still struggle.

So you conclude that you’re dumb because you lowered your tutorial level and still didn’t grasp anything.

But when a new teacher investigates why you’re struggling, they find out that you’ve been struggling because you actually don’t know the English alphabets.

Let’s bring this home to our coding world.

Some people jump into beginner tutorials to learn frameworks like React (ELEPHANT). Then realize it makes no sense so they move on to learn JavaScript (ANT). But that still makes no sense to them, so they quit.

But they’re simply working with something that’s too advanced.

Even introduction courses can be advanced because your thinking is not wired yet to programming in general.

There’s no shame in finding something lower than Intro courses and starting from there to build up to Intro courses.

I don’t see this recommended enough but if you’re struggling with intro courses, you should consider Intro to programming for kids.

Learn with tools like:

  • Alice
  • Scratch
  • Codewars.

Since you’re older, you’ll go through them faster. But they’ll give you the much needed soft intro that makes sense and builds your appetite.

Again, this has nothing to do with ego.

It’s your learning journey.

If you learn the alphabets first, you’ll gain the confidence needed to start spelling ANT, ELEPHANT, and later constructing long-winded sentences.

It doesn’t matter what discipline or area of coding you jump into, this holds for Intro to Python as much as it holds for Intro to Machine Learning.

You’ll learn more efficiently if you learn at the right level.

Elevate how you learn with spaced repetition.

This technique is from research in Neuroscience. And I’ll summarize it short and quick.

How it works:

  • You learn.
  • Recall in 48 hours.
  • Then review in 72 hours.

Doing this:

  • You’ll forget less.
  • Connect new ideas to old; and
  • Retain more in long term memory.

I put 48 and 72 hours but you can expand that timeline to days and weeks. The most important takeaway is not to simply learn once. But to intentionally set aside time for you to come back and review.

The longer the delay between reviews, the more it gets buried in long-term memory.

  • Duolingo uses it.
  • Quizlet adopted it.
  • You can also apply it.

1 project > 10 hello worlds

Don’t get caught up in hello worlds forever.

I understand the thrill of completing simple exercises:

# OMG - I can print all day
print “I am awesome”.
print “You’re cool”. 
print “Wait, are we cool?” 

But I have to be honest with you, this won’t cut it.

Going back to our ANT analogy, no matter how many ways you rearrange the words ANT, you’ll never arrive at ELEPHANT.

No matter how many Intro tutorials you learn, you’ll never really get past the basics unless you push yourself beyond that.

But I don’t know what projects to start as a beginner.

No worries. Here are two examples:

  • Random Password Generator: Creating a program that intakes some words from the user and then generates a random password using those words.

  • Currency converter: Create a program that converts currencies from one unit to another, for example, converting Indian rupee into dollars, pound to euros, etc.

  • If you find these boring, here are 40 other ideas to choose from.

  • And if all of them seem too difficult, DM me on Twitter and I’ll create something specifically for you to start with. Remember, this is not about ego; it’s about your learning level and growth.

Motivation is like taking a hot shower.

Taking a hot shower feels good - you should do it.

But if your hot water is out for 2 weeks, would you not shower?

The question sounds ridiculous but in the same way, you really shouldn’t base your learning on only days when you’re motivated.

There are lots of exciting days in coding; but there will also be dark, unmotivating days.

Honestly, this is not just with coding. It’s with life and embarking on any new adventure. But you have to train yourself to show up not only when you’re feeling hyper inspirational but also on low, boring days.

This doesn’t mean forget motivation.
Far from it - on days when you feel super motivated, use your motivation to quickly commit yourself to something big that will keep you accountable when the motivation goes dry.

How? Join an accountability movement like:

  • 30daysofcode
  • 100DaysOfCode
  • 30DaysOfCodingChallenge

Something. Anything. To keep you accountable on slow days.

In Behavioral Psychology, this is known as pre-commitment. You use moments when you’re optimistic to commit yourself in the future for when you have zero optimism.

The journey of learning is never-ending.

No one teaches you how to learn.

But it’s crucial in going far.

You may have started with the idea of simply learning to code or to one day become a developer. But there’s more.

came-this-far.jpg
    Photo by Drew Beamer on Unsplash

When you come out on the other side, you’ll come out not just a coder.

But as a renewed person because you’ve picked up a new way of learning and approaching things.

Don’t get me wrong. This isn’t easy peasy lemon squeezy – you’ll work like hell.

But in the end, it’ll be worth it not just because of coding but because of the joy of transforming yourself.

Remember, the ball’s always in your court…

Thanks for reading – spread the word!

Not going to lie, this took a lot of hours to put together.

If you enjoyed it and you're on Twitter, like and retweet this to help spread the word. I know it sounds trivial but it actually really helps.

Check out other articles on LifeTechPsych – you may find something else you like.

What's Next?

I’m trying out a new initiative to help new coders and junior devs feel less overwhelmed, manage imposter syndrome and learn smarter.

To be honest, I’m not sure what the entire process looks like yet. But I’m going with the flow and putting together resources and write-ups based on what people need the most help with.

If you’re interested, let me know on Twitter. If you prefer sending a direct message, my DM is open.

Heads Up - I love research so I tend to back my advice and approach with concepts from Behavioral Psychology and Neuroscience.

Top comments (0)