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

793 views

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

In: 33

27 Answers

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.

You are viewing 1 out of 27 answers, click here to view all answers.