Skip to main content

Command Palette

Search for a command to run...

Why Are There So Many Programming Languages? - Part 1

Updated
7 min read
Why Are There So Many Programming Languages? - Part 1

Abhay just joined his bachelor's program, and he started learning to code during his first year of college. Being a complete beginner, he thought:

"Once I learn a programming language, I'm good to go."

He began with Python because his friends said that it is clean, readable, and easy. Then came C in his college course. It felt raw and mechanical, with memory pointers and manual management. Later, he had to pick up JavaScript, for a side project. His classmates were learning Java, Go, and Rust, and he was feeling pressured to learn them as well.

That's when he paused and thought:

"Why are there so many programming languages? And why do people keep inventing new ones instead of just improving the old ones?"

Now, to make a list, we have C, C++, Python, Java, JavaScript, R, Rust, Go, Ruby, Kotlin, .NET, etc. The names above are just the ones I have heard of and can recall at the moment. There are many, many more. And people needed to learn multiple languages to build proper applications.

Now the question

Why..? Why make life hard with so many of them?

To understand this better, try to think of the theory of evolution, not the biological kind in full, but an evolution guided by humans. Life evolved from single-celled organisms to multicellular organisms living in water, some stepped onto land, evolved into multiple types of organisms, each having its own features to fit and survive in the environment it's living in. Among them are primates, which evolved into apes, a particular species then evolved into humans.

So, once humans were here, did all the other apes disappear? Or did the fish just vanish because some organism stepped onto land? Of course not. Each species adapted to its niche.

Though programming is a human-driven evolution, similar to the biological one, one language didn't replace the other. One after another, solved different problems - scientific, business, systems, web and so on. Some got obsolete - yes, similar to the species that couldn't adapt. But those that stuck around have accumulated and now we have a variety of languages existing together.

The Evolution of Computer Language

Where it all started

Now, before stepping into programming languages, let's start with where it all started: Computation. Alan Turing introduced a concept called the Turing Machine, a mathematical model that could simulate the logic of any algorithm. The idea is to prove that any computable problem can be solved by a general purpose machine, what we now think of as separating what needs to be done (a software in today's terms) from the machine executing it (the bare metal, hardware). This is one of the most important contributions to the computer world as nearly all modern programming languages are Turing-complete.

Painful but still a proof of concept

Turing helped design a machine, Bombe (it was not based on the Turing Machine model though), during World War II, to decipher German codes. You can say it's the first attempt to automate logic-based tasks. Though he had a tragic death, he did a great service to humanity with his inventions. Around the same time, ENIAC was born. One had to rewire physical cables and flip switches to program it. Here, programs weren't lines of code but hardware configurations.

Architecture for programming

Then came the Von Neumann Architecture, which introduced the idea of storing both data and instructions in memory. Here, the term "program" takes on a better meaning. One can load different instructions into memory without rewiring the machine like ENIAC. You just need to change the bits in the memory.

BUT, you need to write the program in pure binary, 1s and 0s. Very painful and error-prone, it led to the creation of assembly languages, giving symbolic, human-readable names to instructions and memory locations. It is still extremely low-level but better than writing binary. But there was a different assembly for every processor.

Let's make it readable

But the idea took hold: why shouldn't humans write human-readable terms and let the machine do the work of translating it to 1s and 0s? That is the idea behind a compiler.

Making it easy for scientists

Initially, IBM created FORTRAN (FORmula TRANslation - 1957), as the name suggests, to translate algebraic formulas into machine code to help scientists write math-heavy programs without needing to know assembly language. This made it possible to write expressions like X = A + B \ C*; then the compiler will turn it into machine code and make them work.

Making it easy for businesses

Then there was COBOL (COmmon Business Oriented Language - 1959), which was more business-focused. COBOL emphasized English-like syntax with syntax like IF HOURS > 40 THEN COMPUTE OVERTIME-PAY = HOURS \ OTPAY*, so non-programmers can read it better. It is said to have dominated enterprise applications and to still be found in some legacy systems.

Laying the foundation

Before COBOL, there was Lisp (1958), using lists (catch it in the name). It was the first time implement garbage collection, meaning a language can automatically manage memory without you needing free it when you no longer need it, popularized recursion, and the idea of functional programming. It is said to be the foundation of early AI programming.

There was also ALGOL (ALGOrithmic Language - 1960), which isn't as widely used commercially, but introduced language design with the idea of scopes, block structure with a beginning and an end, and a syntax that influenced nearly all future languages. It was the first to separate syntax, how the program looks, from semantics, what it does. This leads to the development of C.

Next came BASIC (Beginner's All-purpose Symbolic Instruction Code - 1964), programming for everyone. It was meant for education, simple enough to teach students. It exploded on home computers and helped democratize programming.

Software Crisis

Then came the period known as the Software Crisis. Computers were evolving rapidly, but software wasn't. Codebases became messy and hard to maintain everywhere, a phenomenon later became known as 'spaghetti code'; there wasn't a structured discipline which led to a need for structured programming with type safety and better compilers.

Around this time, at Bell Labs, Ken Thompson needed a language to rewrite some parts of the UNIX OS. So he created B from BCPL. It was typeless and minimalistic. Dennis Ritchie, working with Thompson, extended B into C, adding types, structure, better memory control, etc., for systems development. They used it to rewrite the UNIX kernel.

Why C?

C (1972) succeeded because it hit the sweet spot. It talks directly to hardware, similar to assembly language, so it is efficient and powerful. But abstract and readable enough to manage larger programs with variables and data structures, algebraic expressions, control flow (conditional statements and iterations), reuse with function calls, and memory management with pointers, etc.

Also, it was highly portable compared to its predecessors; you can write it once and compile it on other machines (though with minor changes). It follows structured programming with scopes and other concepts from ALGOL.

C is one of the oldest programming languages that you can still find widely being taught. While many people recommend that beginners start their programming journey with Python, as it is much more readable and very high-level, I personally think C is better for starting, as I believe it is the most grounded one, without any wrappers, which helps you understand what programming is and how logic works at a lower level. It can be brutal though.

What's Next?

So, if C was such a powerful language, why didn't it remain the sole dominant language ruling every domain, every program, and every software ever created? Why were Python, JavaScript, Java, and Go and a hundred other languages created?

To answer that, we need to look at why programming languages began not just evolving, but diverging, a phenomenon you must have observed by now in this article, even after the rise of C. And that's what we will explore in "Why Are There So Many Programming Languages? - Part 2." We will go over how different programming languages emerged one after the other, over time, each designed to solve specific challenges, reflect unique philosophies, or serve a particular domain or community, ultimately understanding why we need a multitude of programming languages.