1818-02-02

Which Programming Languages Should You Learn?

Programming Languages 2018

“Which programming languages should I learn this year?” is one of the most common questions I get asked.

It’s a valid question, but it’s difficult to answer without knowing more about you and what you want to achieve.

It depends on…

  • What is your current web development knowledge?
  • What is the purpose of you studying programming?
  • How much time do you have available?
  • Do you want to work for yourself or for a company?
  • Do you prefer frontend or backend?
  • How much are you willing to invest in learning?

In our post about the “Best Programming languages for 2017” over 10,000 readers voted for their favorite language. Here are the results. (Don’t worry: You get to vote this year, too. Just scroll to the end of the post)

Programming Languages 2017_results

JavaScript was by far the winner of our poll.

What are the most popular programming languages?

After doing some research on sites like TIOBE, Trendy Skills, PYPL, Indeed, Google Trends, and after speaking with many leaders in the industry, the most popular programming languages in 2018 are – in no particular order:

  • JavaScript
  • Java
  • Python
  • TypeScript
  • PHP
  • Ruby on Rails
  • Elixir
  • Rust
  • Go
  • C#
  • Swift

When looking at different sites, the ranking of the most popular languages can vary, depending on the parameters you use for your calculation.

For example, according to the TIOBE’s Community Index, Java is the most popular language in 2018, followed by C and then C++. (The TIOBE Index is calculated by using the results of 25 search engines and their most frequent searches. Apart from Google and Yahoo, they also include eBay, YouTube, and Baidu among others.)

Programming Languages 2018

If you look at PYPL, the ranking is different:

PYPL_Programming Languages 2018

While Java is still #1, it is followed by Python and PHP. The PYPL ranking is created by analyzing how often language tutorials are searched on Google.

As you can see: a different approach leads to different results.

One last example, to illustrate my point.

Here are the most popular programming languages used at Github:

Github_Programming Languages 2018

Javascript is #1 here, followed by Python and Java.

Ranking depends on what you are asking and who you are asking. That is something that you should keep in mind when using trend data to determine which programming language to learn next.

We don’t want to give you yet another ranking, but instead, show you 10 widely used programming languages and how people are using them.

Have fun and don’t forget to vote for your favorite programming language at the end of the post.

javascript logo

JavaScript

JavaScript is one of the most commonly used programming language in the world.

Javascript improvements such as ES6 and ES7 have launched recently and made developers weep out of joy. Examples are:

Arrow functions

Arrow functions reduce boilerplate when writing functions. Let’s take a look at one specific example:

// classic
var numbers = [1, 5, 8, 13];
var doubledNumbers = [];
for (var i=0; i < numbers.length; i++) {
   doubledNumbers[i] = numbers[i] * 2;
}

// functional
var numbers = [1, 5, 8, 13];
var doubledNumbers = numbers.map(function(number) {
   return number * 2;
});

We can simplify this example with arrow functions:

// functional ES6
const numbers = [1, 5, 8, 13];
const doubledNumbers = numbers.map((number) => number * 2);

Object/Array Spread

Object spread makes it really easy to avoid mutating objects because it is so much easier to create new objects that contain existing values.  Here’s an example demonstrating it:

// old school
var oldState = { email: 'foo@example.com', comment: 'i really like javascript' };
var newState = {};
Object.assign(newState, oldState, { ip: '192.168.5.87' });

// with spread
const oldState = { email: 'foo@example.com', comment: 'i really like javascript' };
const newState = { ...oldState, ip: '192.168.5.87' };

Async/Await

Sometimes we do need to call functions that have side effects, even in functional programming – e.g. when we’re talking to our backend. Often we even have multiple calls that depend on each other. First, there was callback hell, then came promises, and now async/await has come to make these things even easier.

An excellent guide for learning or deepening your knowledge in JavaScript is the book “Professional JavaScript for Web Developers” by Nicholas Zakas. It is the ultimate collection of tutorials explaining language basics, variables, scope, references types and function expressions. JavaScript has been described as a language that takes minutes to learn, but years to master. This book is a great resource for everyone, no matter if you are a beginner and are reading it cover to cover, or if you are already an expert an use it occasionally to look up a reference type.

If you want to take a deep dive, Douglas Crockford’s “JavaScript – The Good Parts” will walk you through all the peculiarities of JavaScript.

To illustrate each programming language even more, we want to show you the bubble sort algorithm for each language. Bubble sort is a sorting algorithm, which compares adjacent items and swaps them if they are not in the right order. Here is what Wikipedia has to say about it:

“The algorithm, which is a comparison sort, is named for the way smaller or larger elements “bubble” to the top of the list.”

Here is the famous bubble sort algorithm written in JavaScript:

function bubble(arr) {
   for (var i = 0; i < arr.length; i++) {
      if (arr[i] > arr[i + 1]) {
         var a = arr[i];
         var b = arr[i + 1];
         arr[i] = b;
         arr[i + 1] = a;
      }
   }
 return arr;
 }

Recommend reading: Why we have to talk about client-side JavaScript error logging!

typescript logo

TypeScript

TypeScript is a statically typed language that compiles to JavaScript. Version 2.1 includes all the new features of JavaScript with optional static types. Other benefits are stronger checks against bugs in your code and typos, async/await and more. According to Google Trends, the interest in TypeScript is continuously high. (The dip on the right hand is due to the holidays season)

TypeScript offers great resources to learn their language in a short time. In their guide on How to Learn TypeScript in 5 Minutes they walk you through building a simple web application, from installation to running your TypeScript web app.

Microsoft also offers a great online course on learning Typescript hosted on the edX platform. You will learn:

  • Types in TypeScript
  • Programming in TypeScript
  • Modules and Namespaces
  • Advanced Topics in TypeScript

Since many web development libraries are using TypeScript, learning the language is a great skill to have an investment in your career.

To illustrate, what TypeScript looks like, let’s take a look at the bubble sort algorithm written in TypeScript:

export function bubbleSort(array: number[]): number[] {
   array = array.slice(); // creates a copy of the array
   for(let i = 0; i < array.length; i++) {
      for(let j = 0; j < array.length - 1; j++) {
         if(array[j] > array[j + 1]) {
            let swap = array[j];
            array[j] = array[j + 1];
            array[j + 1] = swap;
         }
      }
   }
return array;
}

Java

Java is always a good long-term bet and looking at the stats, it doesn’t seem to be going away anytime soon.

It’s used by over 10 million developers and 15 billion devices run Java worldwide!

Java is used to create Android Apps, desktop applications, games and website content.

Udemy offers some great classes to learn Java. Particularly, this encompassing course stands out. In the Complete Java Class you learn everything about OOPs, variables, exceptions, data structures, and generics. Over 180k people have taken this particular class to learn Java.

Depending on your experience, you might also want to check out a book. If you are a beginner, we can recommend Head First Java. If you are a little more advanced, check out Effective Java by Joshua Bloch. And if you are an expert, chances are you are already reading Java Puzzlers : Traps, Pitfalls, And Corner Cases. 🙂

To illustrate, what Java looks like, let’s take a look at Java’s bubble sort:

public class BubbleSortExample {
   static void bubbleSort(int[] arr) {
      int n = arr.length;
      int temp = 0;
      for(int i=0; i < n; i++){
         for(int j=1; j < (n-i); j++){
            if(arr[j-1] > arr[j]){
               //swap elements
               temp = arr[j-1];
               arr[j-1] = arr[j];
               arr[j] = temp;
            }
         }
      }
   }
}

[otw_is sidebar=otw-sidebar-2]

python logo

Python

Python is similar to PHP and Ruby in the sense that it is an object-orientated language. It closely resembles the English language so it’s a great backend language to learn for beginners as well as seasoned professionals for the more advanced things you can do with Python. Sites like Instagram, YouTube, Reddit and NASA all use aspects of Python.

Python 3.6.4 is their newest release – look at the new features here.

If you want to learn Python, you should definitely check out Real Python. It is an online course that comes with video content, reading material, exercises, sample files, and assignments. The course descriptions reads:

“Essentially, you will learn best practices while building an enterprise-grade web app utilizing a number of tools like Bootstrap, Git, Heroku, Angular, Vagrant, Travis CI, MongoDB, and PostgreSQL, to name a few.”

If you are just getting started with Python, a good resource is Python Crash Course: A Hands-On, Project-Based Introduction to Programming.

Python Crash Course  teaches you how to

  • Use libraries and tools such as matplotlib, NumPy, and Pygal
  • Work with data to create visualizations
  • Create simple web apps
  • Deploy your apps
  • and much more

To illustrate, what Python looks like, let’s take a look at Python’s bubble sort:

def bubbleSort(nlist):
   for passnum in range(len(nlist)-1,0,-1):
      for i in range(passnum):
         if nlist[i]>nlist[i+1]:
            temp = nlist[i]
            nlist[i] = nlist[i+1]
            nlist[i+1] = temp

php logo

PHP

PHP is the most popular server-side programming language.

It’s often used as the foundation of CMS (Content Management Systems) like WordPress and big websites like Facebook and Wikipedia.

PHP 7.1 was released recently – look at the features here.

You can learn the basics of PHP at the PHP Tutorial from W3Schools. The tutorial offers an introduction into variables, arrays, loops, constants, and much more. Visually it is not the most compelling guide, but it is a standard resource for PHP and allows you to look up things when you are building your skills.

Let’s take a look at bubble sort written in PHP’s:

<?php
function bubble_Sort($my_array )
{
   do
   {
      $swapped = false;
      for( $i = 0, $c = count( $my_array ) - 1; $i < $c; $i++ )
      {
         if( $my_array[$i] > $my_array[$i + 1] )
         {
         list( $my_array[$i + 1], $my_array[$i] ) =
         array( $my_array[$i], $my_array[$i + 1] );
         $swapped = true;
      }
   }
}
while( $swapped );
return $my_array;
}

rails logo

Ruby on Rails

Ruby on Rails (a noteworthy framework) is like ‘jQuery for JavaScript’.

It makes it much easier to use Ruby, but it’s advised that you have a good understanding of Ruby before you utilize Rails. The reason why Ruby on Rails is a great and popular choice is because many businesses (small and large) make use of it. Some businesses are: Airbnb, Groupon, Twitter, Shopify and Basecamp.

Make sure you have a decent understanding of JavaScript as you will need to use JavaScript when you advance in Rails. Ruby on Rails 5.1.4 was released recently – look at the features here.

If you want to learn Ruby, I can recommend Michael Hartl’s Ruby guide. This guide will get your from zero to deploy. What makes this tutorial great is that it contains a large number of practical exercises.

Let’s take a look at Ruby bubble sort:

def bubble_sort(list)
   return list if list.size <= 1 # already sorted
   swapped = true
   while swapped do
      swapped = false
      0.upto(list.size-2) do |i|
         if list[i] > list[i+1]
            list[i], list[i+1] = list[i+1], list[i] # swap values
            swapped = true
         end
     end
  end
  list
end

rust logo

Rust

Rust is a general-purpose language that helps developers create fast, secure applications which takes advantage of the powerful features of modern multi-core processors.

It’s also the most loved programming language on StackOverflow for 2017 which says a lot.

Sites that use Rust are: Dropbox and Coursera.

If you want to learn Rust, I would recommend to start with the official book that is now in its second edition. The authors are veteran programmers and know everything you will need to successfully use Rust.

I also recommend to take a look at standard resources at Github. This standard library source will help you understand the design behind the structures you are using every day.

Let’s take a look at Rust’s bubble sort:

fn bubble_sort(numbers: &Vec<i64>, compare_fn: |i64, i64| -> i64) -> Vec<i64> {
   let mut temp;
   let mut target = numbers.clone();
   let length = numbers.len();
   
   for _ in range(0, length) {
      for j in range(0, length - 1) {
         if compare_fn(target[j], target[j+1]) > 0  {
            temp = target[j+1];
            target[j+1] = target[j];
            target[j] = temp;
         }
      }
   }
   target
}

elixir logo

Elixir

Elixir is a dynamic, functional language designed for building scalable and maintainable applications. One of the main benefits is concurrency. In short, it’s great for large applications that handle a lot of tasks at once.

Sites that use Elixir are: Pinterest, Moz and Bleacher Report.

The learning resources from the official page are really great. The resources include video content, books, and screencast. If you are getting started with Elixir, start here.

If you want to connect with a community of Elixir programmers, I would recommend to join the Elixir Slack group.

Let’s take a look at Elixir’s bubble sort:

# Bubble Sort

defmodule Bubble do
 def sort(list) when is_list(list) do
 make_pass(do_sort(list, []), list)
 end

def make_pass(bubbled_list, old_list) when bubbled_list != old_list do
 do_sort(bubbled_list, []) |> make_pass(bubbled_list)
 end
 def make_pass(bubbled_list, old_list) when bubbled_list == old_list do
 bubbled_list
 end

def do_sort(_list = [], _acc) do
 []
 end
 def do_sort([first|[]], acc) do
 acc ++ [first]
 end
 def do_sort([first|[second|tail]], acc) do
 [new_first, new_second] = swap(first, second)
 do_sort([new_second|tail], acc ++ [new_first])
 end

defp swap(e1, e2) do
 if e1 <= e2 do [e1, e2] else [e2, e1] end
 end
end

[otw_is sidebar=otw-sidebar-3]

go logo

Go

Go (or GOLANG) is created by Google and it’s gaining popularity which will only grow in 2018. It compiles fast and it has an excellent standard library that is also great with concurrent programs as well. When comparing Golang vs Rust, while Go excels in concurrency and simplicity, Rust stands out for its focus on safety and low-level control.

Sites that use GO are: Netflix, YouTube and Adobe.

If you are interested in Go, start with A Tour of Go. This official resource walks you through the basics and covers control flow, methods, concurrency, and functions. If you want to dive deeper, check our their blog and their Effective Go, which dives deeper into the Go language.

Start with A Tour of Go: it’s a walkthrough of the language in your browser, starting with the basics and covering control flow, functions, methods, interfaces, and concurrency.

Let’s take a look at Go’s bubble sort:

package main
import "fmt"

func main() {
   x := []int{
    48, 96, 86, 68,
    57, 82, 63, 70,
    37, 34, 83, 27,
    19, 97, 9, 17,
   }
   end := len(x) - 1
   for {
      if end == 0 {
        break
   }
   for i := 0; i < len(x)-1; i++ {
      if x[i] > x[i+1] {
         x[i], x[i+1] = x[i+1], x[i]
         }
      }
   end -= 1
   }
   fmt.Println(x)
}

c# logo

C#

C# (‘see-sharp’) is not only limited to the programming language for Microsoft’s .NET Framework. It’s also used for Windows applications and Android/iOS Apps with the technology from Xamarin.

Version 7.2 is their new release. You can read more about the features here.

Pluralsight offers a variety of courses on C# for every skill level. They also have 6 different courses for advanced C# programmers with topics ranging from “Asynchronous Programming” to “Concurrent Collections”. Pluralsight is more expensive than the Microsoft offerings, but many programmers like the instructors at Pluralsight.

Let’s take a look how bubble sort cab be written in C#:

using System;
public class Bubble_Sort
{
   public static void Main(string[] args)
   {
      int[] a = { 3, 0, 2, 5, -1, 4, 1 };
      int t;
      Console.WriteLine("Original array :");
      foreach (int aa in a)
      Console.Write(aa + " ");
      for (int p = 0; p <= a.Length - 2; p++)
      {
          for (int i = 0; i <= a.Length - 2; i++)
          {
              if (a[i] > a[i + 1])
              {
                  t = a[i + 1];
                  a[i + 1] = a[i];
                  a[i] = t;
              }
          }
      }
      Console.WriteLine("\n"+"Sorted array :");
      foreach (int aa in a)
      Console.Write(aa + " ");
      Console.Write("\n");
   }
}

swift logo

Swift

Swift is one of the fastest growing programming languages in history! It’s built by Apple and they have big plans for it so it would be good to take note of it as the popularity grows.

Swift is what you learn if you’d like to become an iOS App Developer. Their latest release is 4.0 which you can take a look at here.

Start by reading Apple’s official Guide on The Swift Programming Language. This book provides:

  • A tour of the language.
  • A detailed guide delving into each language feature.
  • A formal reference for the language.

Another standard guide also published by Apple is Using Swift with Cocoa and Objective-C. This book dives a little deeper and teaches you how to

– Design patterns and best practices for working with Cocoa, Objective-C, and C
– use Swift and Objective-C in the same app
– migrate your Objective-C code to Swift

Let’s take a look at Swift’s bubble sort:

import Foundation

var array = [5,3,4,6,8,2,9,1,7,10,11]
var sortedArray = NSMutableArray(array: array)

var sortedAboveIndex = array.count // Assume all values are not in order

do {
   var lastSwapIndex = 0
   for ( var i = 1; i < sortedAboveIndex; i++ ) {
      if (sortedArray[i - 1].integerValue > sortedArray[i].integerValue) {
         sortedArray.exchangeObjectAtIndex(i, withObjectAtIndex: i-1)
         lastSwapIndex = i
      }
   }
   sortedAboveIndex = lastSwapIndex
} while (sortedAboveIndex != 0)

// [5, 3, 4, 6, 8, 2, 9, 1, 7, 10, 11]
println(array)

// [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11]
println(sortedArray as Array)

Recommend reading: How to set up CI/CD workflows in GitHub vs. GitLab

If You Want to Be a Full-stack Web Developer:

Learn HTML, CSS, Bootstrap, TypeScript, and 2 backend languages that you prefer. Notable mentions are Node.js, React.js, and Redux.

The good news is that learning a new programming language has never been easier. As we exemplified, there are tons of free or low-cost resources out there supporting you no matter if you are a beginner or an expert.

So what’s next?

Get a head Start with Usersnap

I know, I talked about the best programming languages for 2018, but I want to give you a heads-up on Usersnap, which is a great bug tracking- & testing tool. It is used by startups, as well as companies like Canva, Instacart, Facebook, Google, and Microsoft.

Capture user feedback easily. Get more insights and make confident product decisions.

Microsurveys by Usersnap

Getting feedback has never been easier and we hope you’ve realized that after reading this article. Let us know what you think, your feedback is important.

And if you’re ready to try out a customer feedback software, Usersnap offers a free trial. Sign up today or book a demo with our feedback specialists.