Eli5 why are there so many computer languages?

1.37K views

Why are there things like c++ and python when computers have to be programmed. Why does there need to be so many languages when one could solve it?

In: 222

64 Answers

Anonymous 0 Comments

Part of it is because different languages can be more computer friendly or programmer friendly: assembly (more computer friendly), C, C++, python (more programmer friendly). So you can pick the language based on how much performance is needed vs how long can you spend coding it.

Also, some languages are specialized: matlab for calculation, mathematica for symbolic math, java script for web programs, etc.

There are also many programming languages that serve the same function as another one, but have a different syntax. C++, go, rust for example. There isn’t a good reason for more than one to exist, but it’s simple enough to create one, than multiple people or organizations did it.

Anonymous 0 Comments

One could not solve it.

Software dev here. Not all languages are on the same level. There are languages that are lower level languages closer to machine code (think binary). And there are upper level languages that build on the bottom ones to be more human friendly and readable. Generally lower level languages can be more efficient to run. But high level languages are easier to produce and iterate.

Even if you made a universal language, you’d still need a handful. And you’d have to shut the entire world down for years to update everything.

But the real reason? Someone can always make it better. And as needs evolve rapidly, so do languages.

Anonymous 0 Comments

There IS only one language which computers that have the same CPU architecture understand: machine code.
All high level languages like C, Java, Ada, Python, etc boil down to machine code instructions at the end of the day. The reason there are different languages is because they all do this boiling-down in slightly different ways, so it gives the programmer a variety of ways to solve a problem as these languages have their own pros and cons.

Anonymous 0 Comments

I don’t think it has to do with some being better than others at different tasks. While it’s true that they are to some extent, many languages are interchangeable for many situations, and only exist because someone wanted to design a new language and it caught on. The state of backend web development has gotten absurd–PHP, Node (with or without TypeScript), Java, Python, golang, Ruby, C#, etc. Languages tend to evolve toward being object-oriented, strictly typed, and having block scope. Some started off that way, like Java, while others ended up there, like PHP and Node (with the creation of TypeScript). This is a terrible state of affairs compared to merely using JavaScript on the front-end, even though JavaScript was a pretty bad language to begin with (no block scope, overloaded + operator which does either addition or concatenation depending on the types of variables in a language that supposedly does implicit type conversation, inability to type multi-line strings in the code). Having everyone use the same language, even a sub-par one, would be a step up from having a dozen different popular languages, even if some are marginally better than others at particular things.

Anonymous 0 Comments

There IS only one language which computers that have the same CPU architecture understand: machine code.
All high level languages like C, Java, Ada, Python, etc boil down to machine code instructions at the end of the day. The reason there are different languages is because they all do this boiling-down in slightly different ways, so it gives the programmer a variety of ways to solve a problem as these languages have their own pros and cons.

Anonymous 0 Comments

Different programming languages are designed to achieve different goals. A couple of examples:

Python’s design goal is to be a versatile language that’s easy to read and can get things up and running with relatively lower time investment from the programmer. There are trade-offs to this approach though. Python trades-off runtime speed and memory efficiency to achieve these goals.

C++’s design goal is to be a versatile language that empowers the developer to focus on the speed and efficiency of their code. It trades off ease-of-use and readability to accomplish this. C++ programs often require much more time investment from the programmer compared to an equivalent program written in Python.

It’s more complex than that in reality, but the point here is that there are trade-offs that have to be made to promote certain design goals (at the expense of others). There are different programming languages because which trade-offs you want to make will vary a lot depending on what you’re trying to accomplish.

Anonymous 0 Comments

Improvement.

Over time, people discover problems in a programming language that they’re using, or they want to change it so it does something new or better. If the changes are significant enough, you call the result a “new” programming language..

That’s approximately the same thing that happens with cars: manufacturers make improvements and changes to older car models, to create new models.

But, unlike cars, you need the old programming language because there were programs written in it. And, although programming languages may become obsolete, they don’t fall apart like cars do. So, they tend to stick around for a lot longer than old cars.

Anonymous 0 Comments

Every computer science degree includes how to write a compiler. Every computer science graduate thinks they can invent a better language.

Anonymous 0 Comments

You’ve smuggled a conclusion into your question:

You’ve concluded that one language could “solve it” when in fact nobody who is an expert in computer science would agree with you.

Anonymous 0 Comments

I’m going to interpret the question a little differently than most people have. Setting aside the fact that some languages are better at specific tasks than others, why are there so many so-called “general-purpose” languages that supposedly can do anything? The answer is someone said “Hmmm, so I can do this with X, but it has this one thing I think could be better. I’m gonna make my own language and call it Y” and then another person said “Hmmmm, I think Y could be improved upon” and so on and so forth.