Learning a New Programming Language from Scratch 📝

5 min read

2021-12-26

Learning a New Programming Language from Scratch 📝


So you want to learn how to code? Great! Even though programming may seem daunting at first, the activity is not as difficult as it seems. I promise. Seeing developers with 20 languages under their belt, many of those you don't even recognize seems difficult to attain at first, but the secret is that most programming languages share similar concepts and syntax. Therefore, being proficient at just one coding language at first means that you can pick up other ones much faster.

This blog will attempt to guide you through the steps that I would take and contains advice that I would give myself if I was younger when learning a new coding language by myself.

Follow a free structured curriculum#


When trying to learn the syntax and capabilities of a new language such as Python, it's often helpful to follow along on youtube's many coding videos, interactive websites, and programming books. By listening (or reading) the words of someone more knowledgeable at first, you're able to learn the ins and outs of the language, including best practices and how to even run code. Aside from that, it is VERY important that you are actually TYPING along and not just copying and pasting the code from the video description (or another source). Typing out code allows you to build muscle memory for common commands in that language. So even though that may take some more time now, it will save you the hassle of needing to search up the basic syntax of the language later on.

Here are several FREE websites to learn coding:

Here are several coding youtubers:

Here are several coding books:

Additionally, when the video (or book) uses code that you don't understand and they don't explain, Google what the code means. In programming, Google is your best friend. There is a large community of people on the internet willing to help solve problems that anyone may have. For example, Stack Overflow, one of the most popular question-asking sites, hires professionals to answer questions for you, so don't hesitate to truly understand a topic!

Draw analogies#


When learning a new concept, such as a private instance variable in java, remember to draw analogies between what you are learning and what you already know. For example, a private member in java is similar to one's private parts, in that someone will not openly share private secrets in public. Similarly, private members cannot be accessed by a class outside of the one that it belongs to in Java. Creating connections between new concepts and ideas you already know helps you solidify what you're learning.

Build projects!#


I can't stress this one enough. Build several personal projects with your newly learned skills. This helps you write code on your own AND allows you to realize which topics that you don't have a solid grasp on. Below are a few ideas that you can experiment with!

  • A simple calculator
  • Todo list for yourself
  • Tic Tac Toe
  • Hangman game with graphics (or text-based)
  • Study timer that allows breaks and pausing

Consistency#


Make sure to set some time out of each day for you to learn. Try to stick to this schedule as much as possible, because when learning a new language, it is often easy to "give up" or just "skip a day". While those options may seem easier, you're missing out on the reward of learning a new technique that you can use to solve everyday problems. Try to block out 30 minutes to an hour each day to sit down and learn the programming language. That time should be used entirely for coding. Not 15 minutes looking at your phone and 15 minutes coding, make sure all that time is dedicated to learning! You can be on your phone AFTER you're done :)

Uh oh, my code doesn't work#


When (not if) your code doesn't work, even if it's the same as the tutorial's code, don't panic. This happens. Here's what to do:

  1. Go through each line of your code and make sure that there are no syntax errors (extra parenthesis, missing quote, etc)
  2. Explain each line of your code to a rubber ducky (called rubber ducky debugging!). Include the purple of that line and what it's supposed to do. Believe it or not, this helps!
  3. Do some Googling! Google the error message that your computer gave you. Sites such as Stack Overflow are often very helpful.
  4. Post your question online (along with the code that is messing up) on an online forum. Try to not post the entire code file, but rather, only the part that is causing the issue.
  5. Ask a parent or someone more knowledgeable in that particular language than you are!

Final Note#


It's as simple as that! First, follow a youtube video or structured curriculum to learn the basics of coding in that language. However, make sure that you understand MOSTLY EVERYTHING that is being taught. Then, start building projects (the main bulk of the learning)! Make sure to debug problems that you face, either by googling or posting the questions you have online! Good luck with your journey, and make sure to have fun!

~ Ganning Xu © 2024