DEV Community

Cover image for What is The Best Way to Learn a Coding Language?
Anita Olsen
Anita Olsen

Posted on

What is The Best Way to Learn a Coding Language?

There is many ways you can learn to code. You can learn to code from a book, from an online code learning site, from a course, from watching a video online and you can even learn to code from playing a video game.

What would you say is the best way to learn a coding language?

Top comments (10)

anmolbaranwal profile image
Anmol Baranwal • Edited

I'll share my story, and then you can decide which option fits you best.

I've observed many people following & asking me for a roadmap.
Let me share a bit of my journey.
I'm currently pursuing my B.Tech, so I'll tell it in that context.

I'll focus on JavaScript, but the journey is similar with C++.

First Year:

  1. Completed the University of Michigan Coursera Specialization.
  2. Did Angela Yu's web development bootcamp.
  3. Did freecodecamp and created a portfolio (for someone else). GitHub Repo

Second Year:
Continued creating projects like the Password Generator and 7 others.

Third Year:
Used Namaste JS, Scrimba, Codecademy, Docs, and finally Exercism. Developed various skills, some of which I haven't mentioned.

Fourth Year:
Do you need anything else :D

One thing I'm certain of: the more you practice, the better you become.
In short, I tried a bit of everything -> nothing more, nothing less.

Don't just learn it from a roadmap. Try everything and see which method fits you.
Be a little flexible, a little uncertain and a little confused :D

anitaolsen profile image
Anita Olsen

Thank you SO much for sharing! You are AWESOME! ✨

kwnaidoo profile image
Kevin Naidoo

Depending on your domain: game development, web development, mobile, etc... this will vary, but usually, the best way is to learn the "dialect".

If you look closely most modern languages like Java, JavaScript, PHP, and C# are "C" based, so learn your basics:

  • Data types: variables, arrays, maps, lists, numbers, strings, chars.
  • How to print stuff out and receive input into your program.
  • Then learn basic decision making: "if x > 1 else if x < 1 else" , switch case.
  • Then learn loops: for, for each, do while. Learn how to iterate through arrays, lists, and maps.
  • Modules. How to import and use standard library modules like math for example. How to install and import 3rd party code.
  • How to create and call functions.
  • How to create and instantiate classes.
  • Next, string manipulation. Split strings into lists and vice versa, find an index of a string.
  • Math functions: square root, modulus, rounding, etc...
  • How to build and run your programs.
  • How to step through debug code.
  • Basic SQL: insert, update, delete, select.
  • How to connect to an SQL DB and run queries.
  • How to receive data from SQL DBs and print them out.
  • Basic principals and patterns (you don't have to know these in-depth - just an overview for now): SOLID, MVC, Repository pattern, Singleton, factory pattern, sorting algorithms, KISS, and so on...

Once you mastered all of these, you can now learn any language with ease. Next, you can build small programs and gradually build bigger and bigger apps as your skill grows. Practice makes perfect!

The best place to start is to buy a good programming book by an established author in your language and go through it cover to cover.

anitaolsen profile image
Anita Olsen

Wow, thank you so much for your awesome comment! I highly appreciate it! ✨

mykezero profile image

I've always started off building small, little tools that did something interesting. I use these tools every day, so I tend to gravitate towards them:

  • Sticky notes application: small window for recording notes
    • Extra points for coding the always on top feature
  • PC awake app: simulates pressing the F13 key, which most programs don't listen for, to keep the computer from falling asleep
    • Extra points for adding extra features like:
    • Shut off after X minutes
    • Storing the settings into a config file

Building the small applications helps with learning the syntax, framework and project types (these two in particular would be gateways to learning the WIN32 API)

At this point building something a bit bigger, would bring all these ideas together and would solidify them. I'd personally pick something like creating a video game mod and dive very deep into doing something really cool. This is where you'd bang your head off problems, get stuck, figure out if there's a path forward; really developing your critical thinking skills.

After that, you'd have the base foundation for programming, where you can code confidently in your language and can produce a variety of applications. From there, you could learn other technology like HTTP, REST, SQL, etc. at your own pace.

anitaolsen profile image
Anita Olsen

Awesome advise, thank you so much!

thomasbnt profile image
Thomas Bnt β˜• • Edited

I started learning HTML/CSS by making my own website. By tinkering with lines, and as time went by, I ended up doing my whole blog, and then for my projects.

I used blogs, documentations, videos and a lot of inspect the element πŸ˜†πŸš€

sreno77 profile image
Scott Reno

What form you learn is varies from person to person. I suggest picking a small project that you want to build using the language you're trying to learn. If you care about the project, you'll work harder to learn it.

anitaolsen profile image
Anita Olsen • Edited

A small project it is, thank you for sharing!

stathisg profile image
Stathis Georgiou

Over the years these steps have been proven a good start:

  1. Read the documentation for the basics - for some languages the docs will not categorise the basics in an easy to find way, so any beginners' tutorial will be enough
  2. Find a simple project to work on - nothing big here, make a todo list app or anything that may be of interest
  3. Go back to the docs for everything that you don't understand while building the app until it is done
  4. Repeat.

I think it takes time, but can get you to a hireable state in months.

Some comments have been hidden by the post's author - find out more