Eli5: What is the difference between various programming languages? Dont they all do the same thing?

795 views

Eli5: What is the difference between various programming languages? Dont they all do the same thing?

In: 33

27 Answers

Anonymous 0 Comments

Consider all these things that fall under the heading of “programming”:

* Writing the parts of the operating system that read and write files from disk
* Simulating the flow of air in the atmosphere as part of weather forecasting
* Building the data storage/reading layer for a website to host discussion forums (e.g. Reddit)
* Building the _user interface_ for a website to host discussion forums (e.g. Reddit)
* Building the parts of a game that put graphics on screen
* Building the parts of a game that describe skills and quests and such things.

Now, all those different types of programming have different requirements, with relatively little overlap. Some care deeply about what you mean by “number”, others not so much. Some need to know how, precisely, bits and bytes are laid out in memory, others don’t care about such details.

Different languages make different decisions about what stuff they’ll do for you and what things they’ll let you control directly, and they’ll make different decsions about how you do those things. That means you can choose a language that’s good at the thing you’re trying to do; the alternative, a language that’s good at all the things, is also such a complicated beast that it’s not good at any of the things (because nobody can actually understand it)

Anonymous 0 Comments

Computer programming languages are like our languages. If you tell someone in English to do something, and they understand English, they’ll do it. If you tell someone in English to do something, but they speak French, they’ll ignore you.

Just like real languages, computer programming languages can also be similar. So if you know Spanish, it may not be too difficult to do some things in Portuguese.

And like real languages, computer languages come around because someone, or a group of people, decided they don’t like British English, so they’re going to invent English, and someone else will decide to speak English with a Southern accent. In this example, it’s the same language, but different groups of people have chosen to communicate with it slightly differently.

Anonymous 0 Comments

Well obviously one is the true language handed down by god himself as the ultimate tool for creation and the others are heretical false idols.

Any language that’s “Turing Complete” (meaning it has memory and flow control) can do anything any other Turing complete language can do, but they do it in different ways.

Some languages are more portable than others. Not all computers are the x64 architecture you’re used to on a laptop or home PC. That depends on the compiler-writers.

Some languages are made to create binaries (the programs you run) while others are interpreted or compile to byte-code, which are generally safer but slower. A lot of programming games use their own interpreted language. And these days, browsers are effectively their own compiler and they only use Javascript. So that’s a little… “special”.

Some have more libraries or frameworks to do various things. This is mostly a matter of how many people use them and write stuff to help them and others.

Some are locked down and proprietary instead of open-source, although that’s really out of fashion. That said, some big name languages are really tied to the hip with the corporation that made them, even though they’re open source: .NET and C# doesn’t play well with non-microsoft code, and I imagine Oracle has gotten it’s hooks deep into Java by now.

Some are domain-specific. They’re built with a job in mind. Like “R”. It’s dedicated to statistics. You can do anything with it, but it’s better at handling statistics. (Also, it’s VERY hard to learn how to use if you don’t know statistics, go figure). SQL can do a lot of stuff with a database, but it’s ~~not~~ *technically* turing complete and not the best thing for anything else.

Some languages are “low level” in that the compiler doesn’t do much on it’s own. If you know what you’re doing, you can make these really fast, but in general it’s a real bear to work with and get anything done. Other languages are “high level” and the compiler does more behind your back. Which is great when it works and a real pain when it does something you didn’t want it to do. The holy grail would be the sort of code-generating chatGPT interface that could make software without bugs and did exactly what you wanted it to do… but that’s still just a dream so far. The idea of a “very descriptive set of instructions about what you want the computer to do”… well… we call that “software”.

Anonymous 0 Comments

There can be differences in philosophy, maybe a language focusses on speed but another focusses on reliability or on being easy to use, this influences the design of the language.

Some languages might have been conceived with a specific purpose in mind, such as web development or statistical calculations.

When considering multiple platforms (PCs, smartphones, printers, fridges…) and operative systems there can also be technical differences that limit your choices or have different degrees of portability.

There are obviously differences in syntax where you write the same instructions in different ways, in this sense you can find languages that are more verbose or more minimalistic.

There are different approaches related to how you are meant to structure your programs, this also results in important differences between languages but it’s hard to explain. For example some languages are all about defining the steps one after another, but others let you focus more on how the things interact with each other.

Anonymous 0 Comments

Just think about it as its named. They are languages . This is a priori. Different people create and speak different languages all around the word. But all languages function the same way for the most part and can be understood by anyone who chooses to learn it. Theyre just different languages that people have created. The only difference is, we use it to talk to computers. Which ironically allows us to speak to humans far away from us. Like having a translator. But the language barrier is just distance.

Anonymous 0 Comments

Some are **fast to write** therefore more efficient for the developer; some are **fast to compile/run** therefore more efficient for the processor; some have **more features**, some are more **light-weight**.

Anonymous 0 Comments

The Wrench Analogy:

Think of programming languages like a collection of wrenches in a tool box. You have box wrenches, open wrenches, combination wrenches, adjustable wrenches, pipe wrenches, line wrenches, socket wrenches, ratcheting socket wrenches, and on and on.

All of them accomplish the same thing. They turn a bolt. A box wrench/open/combination is like assembly language. It’s the most basic way to interface with the bolt. It goes over the bolt and you have to manually turn it. When you’re done adjusting a bunch of bolts you have a bunch of wrenches to clean up.

Sockets wrenches are like C / C++. They are a little more user friendly. You can extend them, add an elbow to get around a corner. You have big handles, small handles, different size connectors to between the socket and handle depending on how big the job is, etc.. C++ might be closer to a ratcheting socket, in that it does a little bit more of the work for you. You still have to clean up, but you’ve lost half the sockets already and they’re tiny anyway.

Pipe wrenches, line wrenches, and any specialized wrench is akin to languages like FORTRAN where they have specific uses. Sure they can step outside of their use cases a little, but often it’s more work than just getting a proper wrench.

Adjustable wrenches are kind of like .Net or basic interpreted languages. It’s designed to fit a lot of bolts, but it slips sometimes and isn’t always going to be the best or fastest. Other interpreted languages might compare to the Gator Grip. It’ll work for small jobs, but the second you throw anything big at it, expect it to fall apart.

Next you have impact wrenches. These are like scripting languages, i.e. PHP, Javascript, bash, sh, etc.. It’s a powerful tool that does specific jobs very well but it’s not going fit into a tight spot and give you the finesse of an extended socket wrench.

Then you have Java – that’s just a hammer.