Which Coding Language Should I Learn First?

top paying tech jobs

It seems that you are interested in learning to code, but don’t know where to start. You may have wondered which coding language it is best to learn first, if it is Java, Python, JavaScript, or else. In this article, we’ll give you the answer. Here are top 3 best choices for a new programmer looking to learn how to code.


Coding Language To Learn #1: Python

Python seems like a good choice. It is currently the most popular coding language according to the PYPL PopularitY of Programming Language index. It is easy to learn and it offers clean and well-structured code. It can be used for web and desktop applications, GUI-based desktop applications, machine learning, data science, and network servers.

The good thing about Python is that you don’t need to specify a variable type up front. If you want to declare integer in a language like Java, you have to write “int i = 6;”. In Python, all you need to write is “i = 6”. Python knows you are creating an integer from the number alone. You also don’t need to write semicolons at the end of each code line, all you need to care about is the indentation.

As for money, the average annual salary of a Python developer is 110,232 USD per year, according to Indeed.com, which is a very nice motivation booster.

Here are a few examples of Python code.

Code Example 1 – Code that will print out numbers 1 to 10:


for i in range(10):
    print(i)


This code prints out numbers from 0 to 9, each on a new line. Why from 0 to 9 and not from 1 to 10? This is an important piece of knowledge: in most programming languages, we start indexing from zero, not one. Get used to it. Another thing: Notice how the “print(i)” command is indented by 1 tabulator from the for loop. Such indentation is also a key feature of Python.

Code Example 2 – Code that will print out Happy Birthday three times by name.


names = ["Julie", "Jack", "Martin"]
for name in names:
    print("Happy Birthday, "+name+"!")


the code prints out:

Happy Birthday, Julie!

Happy Birthday, Jack!

Happy Birthday, Martin!


Coding Language To Learn #2: Java

Java is the language in which most enterprise desktop applications and backend development projects are written. Java is also used for coding Android apps, alongside Kotlin. It is a powerful coding language and it can run on any machine from mainframe data centers to smartphones. It is second in global popularity after Python.

Java is a bit harder to learn, compared to Python. You need to write semicolons at the end of code lines, and you have to specify a datatype (e.g. int, float, double, String, boolean) up front when declaring a variable. To declare a floating point number of 4.25, you would write “float x = 4.25;” in Java, whereas in Python it would be only “x = 4.25”.

The average annual salary of a Java developer in the USA is 103,341 USD, according to Indeed.com, which is also very nice.

Example Java code that will print out numbers from 0 to 9:


for(int i=0; i<10; i++) {
    System.out.println(i);
}


Choice #3: Web Development – HTML, CSS, PHP, JavaScript and SQL

These five languages go well together. HTML is a great choice for beginners because it describes the basic structure of something you know well and can see – a static web page. CSS is a style sheet language that describes the website’s look, SQL is a database language, and PHP and especially JavaScript are used to make the website’s content dynamic.

Usually, web developers are split between front-end developers who work on the visual side of a website and back-end developers working on the parts in the background that you cannot see. An experienced so-called full-stack developer knows both sides.

The average annual salary of a JavaScript developer in the USA is 112,530 USD, according to Indeed.com.

Here is an example HTML code describing a table with 2 header cells and 4 data cells that uses a CSS class:


<table class="bluetable">
    <tr>
        <th>Country</th>
        <th>Orders</th>
    </tr>
    <tr>
        <td>USA</td>
        <td>456</td>
    </tr>
    <tr>
        <td>Canada</td>
        <td>123</td>
    </tr>
</table>


Here is an example code from PHP that stores an SQL query into a string variable:


$query = "SELECT * FROM sales WHERE orders > 120;"


Here is an example of HTML and JavaScript code that changes a paragraph when a button is clicked:


<p id="example">This text paragraph will be replaced by “Hello JavaScript!” when you click the button.</p>

<button type="button" onclick='document.getElementById("example").innerHTML = "Hello JavaScript!"'>Click Me!</button>


Summary

We have looked at three main directions which you can take as a beginner. When learning how to code, we recommend to start with Python or Java, and in case web development is something of interest to you, we recommend to learn JavaScript, HTML, CSS, PHP and SQL.


This article is brought to you by Coding Job Guide, a free internet guide to finding a well-paid software development job.