Back
Question
Asked

How would you learn to code?

I am doing freecodecamp now but I feel it will take forever to build what I want. 

What would you do?

Find a mentor? More courses?

Thanks


You can only do much by learning to code from scratch now. The best is to use boilerplates, starter kits or even no-code tools. Use the coding knowledge to familiarise yourself with the codebase and tweak as you go.

Another way is to take a section of codes and ask GPT or Claude to explain line by line, or just simply ask "What does this do?".

tbh, I still do that because my work requires me to interchange languages quite often. I'm a Rails dev by skill, but quite frequently I do Astro/Svelte and Python (AI-related jobs), etc.

I think it is an amazing idea. Thanks!

I started with online bootcamps and udemy courses but never got anywhere. Then changed the learning style to learning by doing small mini projects I can code and deploy in a few days. That worked. It made me stay interested cos those are projects I like (not some random project by the instructor), and deploying means I could share it, learn/build in public, and others could join in the journey. If I were to start now I would use AI to learn alongside that approach. It would 10x the speed of progress I feel

this is an excellent advice. Thank you, Jason!

"I feel it will take forever to build what I want."

IMO this is the #1 most important thing to understand about programming. Stuff can take way, way longer to make than people imagine when they first get into it.

But yeah the best way is with a mentor who actually cares about you and can guide you towards reasonably-sized projects and help you get past sticking points.

Think of something you want to built and ask ChatGPT or Claude how to do it, follow the steps and ask it when you have problems, use Google if it ever fails you.

so I did this one and tried to deploy the code but it returned bugs that I did not know how to solve.

Maybe I should try again and post my problem online!

Yea do that if you have to, you can copy and paste the bugs into chatGPT and get good solutions almost all the time, sometimes you may have to consult Google or stack overflow.

  1. Learn a bit of theory about what imperative programming is about and a bit of syntax and semantics of a language that you want to start with.
  2. Choose a thing you want to build. Something simple. Like a program that reads a text file provided in the arguments of the program and outputs the number of words in it.
  3. Write down on a piece of paper what the solution will consist of. High-level design.
  4. Describe each component of a high-level design in detail.
  5. Now write down an algorithm that each component implements in plain English or pseudocode.
  6. Convert the algorithm description or pseudocode into an actual code in the language of your choosing.
  7. Test your solution and fix the bugs.
  8. Choose a more ambitious task. Repeat the process.

Thanks! Can you do imperative programming with Java Script?

The important question is.. are you learning coding to build your own products, or to be a professional software engineer? Very different paths

How so?

One is for enterprise, good to have CS credentials, fundamentals is a must, good to learn what companies are hiring for (like React). Indie hacker, you don't need to get CS cred, learn just enough coding to launch, also must learn business, learn what helps you ship fast.

I think this is a different question you're answering.
It's not about getting a job.
It's about learning to code: reasoning about the task at hand and solving it with the tools that the language provides.
The nuances come into play at a much later point: working at faang vs working at regular company vs working in body shop vs working in a startup vs indie maker.

Maybe priorities best explains it. Code is secondary to me. It's just one piece out of many moving pieces. I don't care if I learn how to code comprehensively or not. I ship crappy code. I only care enough that it makes customers pay. For SWE, code is primary.

yeah very curious on your take

@sandra So what's your answer

definitely to build my own products :)

Then just learn scrappy, hotchpotch code together, build something small, and progress by doing. No need to worry about being thorough in knowledge and knowing all the fundamentals.

I would probably start building an app with bolt.new or Replit and when that tool starts failing you, you will be forced to learn whats going on. Idk. Don't be afraid to just start building something, take a course on the side, and learn as you go. You are going to suck and look back at how bad your code is but its a rite of passage for a dev. Dive in.

thank you Grant, I will check this tool out

Past freeCodeCamp's JS curriculum contributor here 👋

I personally don't like the present freeCodeCamp curriculum. Quincy (founder) has plans to change this in recent future. Till then let me help you learn to code in a more effective way.

See, when I started learning to code, I read many tutorials, watched some youtube videos, did some freeCodeCamp as well, to me, none helped much.

Then I stumbled on cs50 a free course from Harvard -- cs50.harvard.edu/x

This changed everything for me because they left me on my own to build stuff with their problem assignments (they are practical!) and when I look back I realise that the right way to learn to code is:-

First, watch / read concepts. See how they get together to make a small thing.

Second, you yourself make a small do-able project. Don't focus on making too many, making even one but making yourself will give you the required feedback to your mind that you are actually learning. Use Google / Claude to ask lots of questions, but write by your own in the beginnings.

Third, steadily build up on other areas. Like you start with HTML, CSS and then JS and then Python for backend. Then making a full-stack blog maybe.

Essentially, stop freeCodeCamp and focus your energy on doing CS50 -- it will make you a deep-rooted developer.

Disclaimer guys:
I ain't connected commercially to cs50 or freeCodeCamp. I have been a past contributor to freeCodeCamp and have taken CS50 myself. So all of the above is my personal experience and personal opinions. Doesn't reflects freeCodeCamp's views or CS50 views.

Let me know @sandra what you think of my thoughts!

@sandra please ask me any question you have, no question is silly remember!

I would love to help you navigate learning to code!