How to learn to code

Learning to code means picking one beginner-friendly language, following one structured course, writing and running code every day, and building small projects as soon as you can. You can do all of it for free, with four habits:

A dark screen showing many lines of code with line numbers
A screen of code with line numbers, the first view of a program you write yourself.Photo: fancycrave1 / Pixabay
  1. 1

    One language first

    Python or JavaScript, as in CS50P and MDN.

  2. 2

    One course

    Finish it before you switch.

  3. 3

    Code every day

    Type it, run it, break it.

  4. 4

    Build projects

    Small programs you actually use.

Learn in Evernote. Clip the docs, let the AI Assistant fix your code, and search any snippet.

Start your coding notebook in Evernote

How to learn to code in 6 steps

  1. 1

    Pick a goal and a language

    MDN's beginner course teaches JavaScript for web pages; Harvard's CS50P teaches Python. Choose one and stay with it until you finish the course.

  2. 2

    Choose one free course

    Harvard's CS50x is free through OpenCourseWare, with eleven weeks of material and no prior experience needed. freeCodeCamp offers a free, project-based curriculum.

  3. 3

    Write code every day

    Type every example yourself and run it. Change one thing and predict what will happen.

  4. 4

    Read the error, then fix it

    Error messages say what went wrong and where. Fix the first one, run again, and keep a note of each fix.

  5. 5

    Build small projects

    A tip calculator, a quiz, a to-do list.

  6. 6

    Share and read other code

    Post your projects, read other people's code and ask questions in the course community.

A first month of coding

About 30 minutes a day, in Python
  1. 1Day 1Goal: automate a weekly spreadsheet task. Language: Python. Install it.
  2. 2Days 2 to 7Week 0 and 1 of CS50P or another Python course: variables, strings, if.
  3. 3Days 8 to 14Loops and lists. Type every example, change one thing each time.
  4. 4Days 15 to 21Functions. Break your code on purpose and read each error.
  5. 5Days 22 to 30Project: a program that renames a folder of files.

Free coding practice log

One entry per session. Copy it, or save it to your Evernote account and keep your snippets in the same note.

Date: [day] · Time spent: [minutes]

Topic: [one concept, like for loops or functions]

Source: [tutorial, chapter or video, with its link]

What I built: [a small program, in one line]

Error I hit: [the last line of the error message]

How I fixed it: [one sentence, plus the corrected snippet]

Next session: [the next concept to learn]

Trusted by Millions Worldwide

4.4

2,100+ reviews on G2

4.4

8,200+ reviews on Capterra

4.4

73,000+ reviews on App Store

248M

Registered users

Learning to code questions

Can I learn to code for free?

Yes. Harvard's CS50x is free through OpenCourseWare, and freeCodeCamp is a charity that offers a free curriculum and certifications.

What programming language should I learn first?

Start with Python or JavaScript: Python is the language of Harvard's CS50P, and MDN's beginner course teaches JavaScript for web pages.

How long does it take to learn to code?

CS50x covers the foundations in eleven weeks of material plus a final project. How long it takes you depends on your schedule.

Do I need to be good at math to code?

No. Everyday programming is about storing values, making decisions and repeating steps. Math matters when you work on math-heavy fields such as data science.

Can I learn to code online?

Yes. CS50x is free through OpenCourseWare, and freeCodeCamp offers free lessons and certifications that run in a browser.

How do I stay motivated?

Build things you want to use, keep a log of what you learned each day, and join the course's community.

How to learn to code with Evernote

Keep one notebook for coding: the beginner pages you clip, your first programs, and every error you fixed.

  1. 1

    Clip the beginner page.

    Save Python for Beginners with the Web Clipper. Keep it in a notebook called Learning to code, with the install steps and the first program in one place.

  2. 2

    Ask why the program fails.

    Put your first program and its SyntaxError in a note. Ask the AI Assistant why the line will not run, and accept the closing parenthesis it adds.

  3. 3

    Find input again.

    Search for "input" when you need the syntax again. Evernote finds it in your clipped page and in your practice note, and opens the match.

  • You can also ask the Assistant for a practice task that repeats every day.
  • You can also log your projects in a table, with a link to each one and what you learned.
  • You can also save screenshots of error messages, and search finds the words in them.

Every snippet, error and fix in one place

Clip the docs you learn from, ask the AI Assistant why your code breaks, and find any snippet again by searching for it.

Start for free