How to learn programming

How to learn programming
Photo by James Harrison / Unsplash

I've been programming professionally for more than 7 years now, and recently I was thinking back to when I first got into programming. I know a ton of people who are learning to program, for fun, to improve their career prospects, to grow their businesses, etc.

I am a self-taught developer, having no formal education in computer science. All of my learning has been self directed.

Project-based learning

Learn faster, understand concepts in context, and have fun at the same time

I am a big proponent of project based learning. I remember slogging through the Learn Python the Hard Way book, going through the interactive courses on Codecademy, or using courses from Udemy, and none of those approaches kept my attention. They were not very engaging because they'd talk about a concept and I would have no idea of its practical use, and that made concepts hard to understand. I had just about given up, even thinking "maybe I'm not programmer material", but there was an app I really wanted to exist, and I knew no one else would make it.

So I said fuck it, chose Python and Flask, and just started building my app. There were many stumbling blocks, and I frequently felt way out of my depth, but I was also excited to see my project coming along, and that kept my passion going. Every time I would get stuck somewhere, once I finally "got it", it was immediately applied to my project, so I knew why something was necessary, and for some reason, once you understand the why, it becomes a lot easier.

So pick a project you want to build, and give in head-first. The worst that can happen is you fail to build it, but you will learn a huge amount along the way.

Getting help

And helping others help you

You will need help along the way. You are learning something built by other people, and whether you're doing a course, reading a book, it's all built by other people. So you will need their help. Programmers are asked for help very often, and while they are happy to help you in most cases, if you do not show them that you've tried to figure it out yourself, what you tried, what you think the problem is, they will consider you lazy and not worth the effort. Remember you are asking someone to use their free time to help you, for free. Try out 10 different ways, do research online, and when all the options are exhausted, reach out for help and you will receive it.

Learning how to learn

The most important skill for a programmer to have

No one becomes a programmer to get hired as an intern. You want to progress in your skills, right? If you don't learn how to upskill yourself, and don't make it a habit to do so, you will stagnate. Technology moves incredibly fast. I've worked with like 10+ frameworks in 7 years, and there's new ones coming out every day.

If you don't learn how to teach yourself, you will not get far.

Also you have ChatGPT now. Ask it how to explain concepts to you using analogies like you were 11 years old, and ask it to suggest follow-up questions with each answer that will help you improve your understanding further.

ChatGPT

ChatGPT has taken the world by storm and I believe it deserves its own section. Now you have 24x7 access to an all knowing, tireless mentor who will answer almost any question. Learn to use it well. I believe you can compress your learning timelines significantly by using ChatGPT.

ChatGPT can be wrong, blatantly, or subtly. Experienced programmers are able to spot wrong answers and guide ChatGPT towards right answers, but inexperienced learners don't have the knowledge to spot these issues. So learn how to use proper prompting, double check anything ChatGPT tells you, and use it as a boost not a crutch.

Perseverance

Programming is hard. It gets easy, but first, it gets harder and more frustrating as your learning journey progresses. If you really want to do this, then do not give up. Also, avoid the allure of trying different frameworks or languages. Don't try to run before you can walk. You will only get more confused and it'll slow down your learning journey. It's crucial that you stick with one language until you have a firm grasp of the fundamentals, because once you do, switching to another language is very easy.