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

773 views

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

In: 33

27 Answers

Anonymous 0 Comments

Eventually, yes. Any programming language can achieve the same thing as another programming language (as long as they’re Turing-complete, but that’s beyond ELI5).

The difference isn’t about their capabilities, the difference is about their features. For example, take Python – it’s not a compiled language, but an interpreted one. In practical terms it means it’s slower, so what are the advantages? Well, it’s easier to read and easier to write for humans. Take C/C++ – it’s compiled, it’s way faster than Python, but you need to have some serious knowledge to write very efficiently in it. Or take MATLAB – it’s not even really designed for programmers, it’s meant for mathematicians/physicists.

Each programming language has some features that it excels at but at the cost of other features. It’s impossible to write a language that’s super-fast, super-easy to learn, super-fun to write in and has all the super-features programmers love, so programming languages compromise.

Anonymous 0 Comments

They follow different logic principles.
Some are more oriented on hardware (e.g. Assembly). It was created in the early times and you address the hardware.
Then there are languages that are logical like Prolog.
Fortran is used by mathematicians.
PHP is backend, to manage servers, JavaScript is more useful for designing the layout of your website (JavaScript is for giving the input data to the backend, PHP or Python manages this data and gives back results).
Java or C or C++ are examples for high level languages. You don’t necessarily speak to the hardware (C is quite close to the hardware), but a compiler takes your code and brings it to action. For example you don’t need to worry where exactly your data is stored bc there are a compiler and your system that manage these questions.
In Java or Python you give direct commands, in Prolog your code consists of facts and rules. It’s more logical.

TL,DR: they follow different thinking patterns and are more or less directly talking to your hardware.

Anonymous 0 Comments

Yeah, there’s 90%+ overlap between most of the big ones. A lot of it is “this is the way we’ve always done it” in particular company or industry, and sticking with one is way easier than migrating to a different one. But some have certain strengths and weaknesses where it would actually make sense to pick one over the other.

Anonymous 0 Comments

Think about programming languages like cars.

All of them have wheels, but some are better than others at a typical use. You would not use a time attack asphalt race car to drive to wallmart, nor would you use a typical economy car to drive on a lake . (Yes some people do that, they are mad, but it works provided you just put nitrous through a big V8 and floor it. Check ice land offroad racing … it started as a road climbing event. Then they realized they could drive ON water, so they just did)

Anonymous 0 Comments

Think of it like different kinds of hammers, maybe.

Using a sledgehammer to put up a picture hanger in a regular wall would be difficult, and likely cause a lot of other problems. A lighter hammer wouldn’t risk as much. A very light hammer, like a tack hammer, could also be used. It would also be difficult, but for different reasons than the sledgehammer.

Anonymous 0 Comments

Well it seems like the programmers sometimes don’t know what they are doing or not choosing the most efficient means for a programing a language. I know of some that would rather use interns who hate the program all together and spend their time sabotaging it instead of fixing it. Something as delicate as programming should be handled by more experienced personnel who respect the program for it uses. Since they see the benefits of it they wouldn’t work to sabotage it

Anonymous 0 Comments

It’s a bit like toys to build stuff. Think about Lego blocks, Lincoln Logs and an Erector set. You can build a house with any of them but the house you end up with is going to be different. The erector set house is probably the strongest but might take longer to build. The Lincoln log house might be the weakest but was really fast to build.

So yeah, the all do the same thing — tell a computer what to do. But some languages are easy to use but more limited. Some are more powerful but are challenging to master.

Anonymous 0 Comments

Nominally most languages can do most things pretty well. Languages have all sort of different ways they let you organize your thoughts and instructions and how you express those through the language.

As an example variables often have Types in languages that describe what kind of data is in that variable (IE a time and date, a number, a word), ignoring for the moment why a language needs to have types. Some languages are statically typed, they require the programmer to declare the type of every variable they set aside and that type can never change. They throw errors and refuse to compile if you violate those types. Some languages let the programmer suggest the type but allow it to change to anything related and try to guess the most logical intention based on the hints the programmer has given. Some languages don’t care at all and let variables be any type and change types at any time without checking at all what’s being stored in it.

It’s a trade off between expressiveness and stability. Languages with strong typing systems often have a reputation of being less expressive, more clunky, more verbose, since you need to be much more specific with how you tell the computer to organize the data. While languages with looser typing systems feel easier and faster to write in, they’re more flexible, sometimes you can be clever by reusing variables, etc…but when faced with ambiguity a looser type system may make the wrong decision and create a bug or just crash entirely.

Some languages can suggest paradigms that impact performance. Like Javascript and Typescript for a platform like NodeJS make _heavy_ use of non-blocking I/O meaning the language isn’t necessarily going to wait until one line is completely done executing before starting on the next one if it thinks it can get away with it. So I/O heavy operations _can_ be faster in Typescript than blocking languages like Java or Python, but you can very easily accidentally over-parallelize code or lose track of the order things happen in so the trade off that let you get more performance also let you accidentally introduce other bugs.

Anonymous 0 Comments

This question is kinda similar to asking why we have different communication languages, when they all do the same thing. We just do, and trying to convince everyone to switch to a single one will never work.

There are advantages and disadvantages to each depending on the exact circumstances you’re working under, but realistically speaking people just use whatever they have to because they’re building on top of something that’s already been written in a particular language and it’s easier to continue that than it is to rewrite the whole thing.

Anonymous 0 Comments

One of my first computer classes was one on languages. I studied Algol, Snobol/Spitbol, LISP, and Assembler. Each language is quite different, and was designed to do different things efficiently.

“Algol” was an algorithmic language, meant to help scientists and engineers do the messy calculations of a Fast Fourier Transform, or some numerical method, easily and quickly.

Snobol and Spitbol were languages designed by Bell Canada, looking for ways to speed up “411 information” services, which they were legally required to provide for free. These were essentially very fast search routines which allowed for what we now call ‘fuzzy’ inputs and outputs. For example, if you wanted a Smith on Maple, it might also return a Smythe on Oak.

LISP (‘Lotsa Irritating Silly Parentheses’) is a contraction of “List Processing”, and was the language of choice for AI in the early days. The program had two basic commands, *car* and *cadr*, which meant take the right branch or left branch. The tree was a bunch of choices encapsulated in rounds and rounds of parentheses. When you are trying to do this on a keypunch machine where the ribbon has been used so much, there are no legible marks on your cards, you will spend 10 or 20 runs just getting the punctuation correct. It was a nightmare. (I’m sure it’s better now on a terminal)

Finally, assembler, or machine language, is the actual instructions to the microprocessor to do things at a bit or byte level. For example, you don’t work with a file, you work with a “register”, which is a special location on the CPU chip. There are commands that let you shift bits sideways in the register, and commands that let you compare bits between one register and another, and all the loops and conditions that you find in any programming language. The challenge is to understand what’s going on at the very lowest level of your logic.

Hope this helps.