Comparison of 10 Programming Languages.

Anmol Singh Sethi
4 min readMay 15, 2020

An experiment comparing the speed and runtime of 10 most commonly used programming languages namely, C, C++, C#, Golang, Java, JavaScript, Kotlin, Python, Ruby and Rust.

Photo by Luke Chesser on Unsplash

Problem that I experimented with…
For this activity I tried solving Kids With the Greatest Number of Candies problem present on LeetCode. In this problem we are given with an array candies and an integer extraCandies. We have to find for each kid if there is a way to distribute extraCandies among the kids such that he/she can have the greatest number of candies among them. This particular problem had 103 test cases. You can refer to the problem linked to checkout the input-output files and constraints, and, of-course if you wish to solve this.

Since I am not very well familiar with all these programming languages, it took a lot of googling the syntax for this comparison. Overall comparisons of these languages:-

Memory Usage Comparisons
Runtime Comparisons

Now, let us delve deeper into the performance of each of these languages and also knowing about them briefly!

C

C is a powerful general-purpose programming language. It can be used to develop software like operating systems, databases, compilers, and so on. C programming is an excellent language to learn to program for beginners. Following are the stats when using C

C++

C++ is a powerful general-purpose programming language. It can be used to develop operating systems, browsers, games, and so on. C++ supports different ways of programming like procedural, object-oriented, functional, and so on. This makes C++ powerful as well as flexible. Following are the stats when using C++

C#

C# is a general-purpose, object-oriented programming language. It is one of the most popular languages used for developing desktop and web applications. Being a C based language, C# is closer to C++ and C. Syntactically, it is similar to Java. Following are the stats when using C#

Golang

Golang, is an open source programming language. It’s statically typed and produces compiled machine code binaries. Developers say that Google’s Go language is the C for the twenty-first century when it comes to syntax. However, this new programming language includes tooling that allows you to safely use memory, manage objects, collect garbage etc. Let’s look at the stats

Java

Java is a powerful general-purpose programming language. It is used to develop desktop and mobile applications, big data processing, embedded systems, and so on. According to Oracle, the company that owns Java, Java runs on 3 billion devices worldwide, which makes Java one of the most popular programming languages.

JavaScript

JavaScript (JS) is a lightweight, interpreted, or just-in-time compiled programming language with first-class functions. While it is most well-known as the scripting language for Web pages, many non-browser environments also use it

Kotlin

Kotlin is a relatively new programming language developed by JetBrains for modern multiplatform applications. Nowadays, Kotlin is widely used for Android development instead of Java. It is because Kotlin is safe, concise, and fun to read and write.

Python

Python is a general-purpose interpreted, interactive, object-oriented, and high-level programming language. It was created by Guido van Rossum during 1985- 1990.

Ruby

A dynamic, open source programming language with a focus on simplicity and productivity. It has an elegant syntax that is natural to read and easy to write.

Rust

Rust is a multi-paradigm programming language focused on performance and safety, especially safe concurrency. Rust is syntactically similar to C++, but provides memory safety without using garbage collection.

Note that, the test cases against which problems are tested are language specific and also the code that I wrote might not be performing the exact same operations in each of the language variants. Moreover such things are IDE dependent as well. These are just my findings which could be different from yours or the actual values.

Stay updated for more!

--

--