How to learn a programming language?
Tags: webdev, howto
Published: 2020-02-21 13:05:37

Hey there DEV.to community.

Currently, I'm studying computer engineering at Tabriz University and one of the things that everyone asks me is how to learn a programming language and how to do it quickly (I hate that English doesn't have fastly :|).

This matter gave me an idea to write this post and share my experience with everyone.

![Let's get started](https://media0.giphy.com/media/vA4EnqvJxDv2g/giphy.gif)
<figcaption>Let's get started</figcaption>

# Choose a relatively easy programming language

When learning programming languages if you struggle about some aspects like data types and return types in programming languages like Java or C++ I suggest you start with a higher-level programming language like JavaScript or Python.

Keep in mind that although this method can help you learn programming faster, this can cause you some trouble with getting back to some harder languages. So don't try to completely avoid the language you initially intended to learn.

# Don't get bored

Learning a programming language can be boring sometimes for some people (not me! I really love learning computer stuff XD), so don't push yourself too hard since you can get bored and that can affect your learning path.

Whenever you feel that a subject is too hard for now just skip it and start practicing other features that you know. Seeing that you can write your own program even with some basic coding knowledge will encourage you to keep it up and move forward.

# Which programming language is the best to start with?

Maybe this is not that much relative to this article but it can be really important about learning.

The answer is there is no best programming language to start with, every programming language has its own pros and cons relating to the field you would want to use it.

JavaScript is great for web apps, Python is great for AI, C++ is great for hardware programming, PHP is great for back-end programming and so on.

(Examples above are just intended to be there, I know you can write AI with C++ or use Python for back-end programming XD)

So you first should choose your path and what you want to do then choose the best tools available for them.

I'm listing some below:

**Web development**: HTML, CSS, JavaScript for front-end and one of PHP, ASP.NET (C#), JavaScript, Go or Python for back-end and SQL for your database.

**Desktop app**: Java or C++ but I personally prefer Java. You can also use JavaScript with Electron to create desktop apps but it is a web app behind the mask.

**Low-level programming**: Low-level programming usually means getting direct contact with the hardware. C/C++ and Assembly are the two most used programming languages for this matter.

**Android/iOS apps**: Currently by using NativeScript or React Native you can design native Android/iOS apps with JavaScript but a more genuine way to that is to use Java/Kotli for Android and Swift for iOS.

**AI**: Well, I'm not that much involved in this part but as far as I know and my friends told me Python is the most reliable one in this case and the libraries that are available for AI in Python are really great.

# Try your coding skills with some challenging samples

A very well-known way of challenging yourself is to write a simple game like the very famous snake game. It is possible to write this simple yet challenging game in almost every programming language.

The snake game will challenge you to get user inputs for movement and using static states in classes to gather some data such as how many dots your snake has eaten and you will have to use the random number generator for spawning the dots in random places.

If you want to go furthermore, try to make a simple weblog using a simple HTTP library that runs in your preferred programming language.

# Follow some YouTube channels

I can confess almost 80% of my programming knowledge is thanks to YouTubers and I believe almost every programmer is also like me and they learned most of their skills from YouTube.

Before going any further let's give a round of applause to all my Hindi friends teaching programming on YouTube.

![Hindi's teaching meme](https://dev-to-uploads.s3.amazonaws.com/i/vu3vp8x64lj1yzuhtl65.png)

Hitesh is one of the guys I learned so many things from and really like his videos.

{% youtube dlfrWbYk1v0 %}

And Mosh Hamadni (I think he is Iranian, not sure though) is a great tutor too. For those who want to learn Java, I really suggest the video below:

{% youtube eIrMbAQSU34 %}

These guys have some paid courses as well, but I believe learning programming can be done for free if you are enthusiastic enough.

Me myself I've never paid for any courses for programming.

# Try to share your knowledge

Sharing knowledge not only benefits the guys you are sharing with but it benefits you more! When you are trying to teach something to someone (even from the really basic knowledge you have) you might question yourself something that you never thought about before, even, the guy who you are teaching to can also ask a question that you don't know the answer so it will make you go and search!

Don't be afraid about saying "I don't know", no one knows everything!

# Search, search, search!

Google is your best friend! Search everything you encounter with. Searching will help you find your answers even quicker than asking your friends!

By searching a solution for a problem you will learn 10 times more since you will encounter many more aspects even not related to your problem.

As much as you search you are going to gain knowledge.

# Try to learn two programming languages at the same time.

Many people will tell you that you better learn one programming language at a time but I'm suggesting you do the exact opposite and I have a reason for that!

Learning two languages at the same time can help you tremendously! Each language has some aspects that the other one might have it in a different way that is not visible! I call them hidden aspects! XD. It will be really helpful for you to learn them in another language and try it in the other one.

So what languages to learn together? For instance, learning JavaScript and Python at the same time cannot make that much difference since they are both a very high-level programming language (Python even more than JavaScript). You can start with Java and JavaScript or Go and Ruby together.

# Codecademy!

Codecademy is one of the best ways to learn a programming language!

[Codecademy](https://www.codecademy.com/)

Follow the link and sign up and use its free courses. They are interactive and will teach you in a really enjoyable way.

---

Tell me your ideas in the comments section below and correct me if I'm wrong.
I hope you enjoyed!