Why are some programming languages better for certain types of projects than other programming languages, when they can all essentially do the same thing and they all seem to work the same way?

23 views
0

Why are some programming languages better for certain types of projects than other programming languages, when they can all essentially do the same thing and they all seem to work the same way?

In: 20

they do not work the same way. different tasks are easier in different languages. Because the main reason for making a new language is to simplify a task that is hard in existing languages.

Programming languages don’t work the same way under the hood and generally the more simple a language is to code in the slower it runs as the compiler (the things that translates code to a language the computer can understand has to work harder). This is why for very memory intensive applications it’s much better to use C/C++ over a language like python or Java

Let’s take some extremes. MATLAB is designed to do math. Scientists and engineers love it because it allows them to do some very complicated high-end math very easily. It also natively does 2D and 3D plots of the data. Contrast with SQL, which is designed for databases. It’s strengths are input and output of data, and manipulation of it. Doing math stuff on SQL, or database stuff on MATLAB, wouldn’t be very efficient.

A programming language is the interface between us as humans and machines.

One key difference between different programming languages is how close they are to the machine (or the human respectively). Close to the machine means in general more control/options and better performance but also more possible problems and requires a more advanced understanding over all. If the language is closer to the human it becomes easier to learn but you lose performance and control over certain things. Depending on your project you may what to pick one over another based on your requirements in this area.

(Note: This is just one high level example how programming languages differentiate)

Is all about abstraction and premade tools, blocks, functions.

Yes, in the end all languages are converted to machine code, that cpu understands and executes. Theoretically you could write everything in machine code, but it would be huge waste of time. That’s why we have created different languages, which abstract theses things and gives us premade tools to work with. Just every language is made with different toolset (usecase) in mind.

There are languages that converter code from that into lower level (more generic, closer to hardware) languages code. To make complicated things more easy, but usually thus sacrificing performance and resource usage.