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?

432 views

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

19 Answers

Anonymous 0 Comments

I haven’t seen a good ELI5 so i’ll do my best here.

All machines run ‘machine code’ which is binary data which asks the processor *do something*

How those instructions are written out, and converted to machine code, is the job of the programming language.

Languages are geared to be optimal for writing clear instructions, as well as executing their work optimally. But depending on their requirements, they might not do everything great, so there is always a trade-off.

Want to write a game engine, where every microsecond matters? And you want to optimize where the bits go so that the machine prioritizes 60fps instead of realtime AI? Then you want a language that gives you this level of control:

– vector and 3D math

– a variety of frameworks to manage graphics

– a language which is universally supported by many gaming machines

– a system robust enough to handle a configuration that optimizes your machine code for intel processors, Arm processors, AMD processors, 64bit processors, with 32bit backwards compatibility, etc

Do you want something that just lets you injest a spreadsheet and do complex math equations, but doesn’t really care about the rest? You can do this in 10 lines of code in some languages, with a guarantee that it’ll ‘just work’ across all systems.

And to be fair, they all DO do the same thing. But it’s the question of:

– how do you feed it instructions (1 line of code or 100 lines to do the same thing)?

– how does the language compile the instructions into action? (which is the job of the compiler, but I’m bundling it with the language here for simplicity)

So it’s not necessarily WHAT they do, but HOW they do it that makes a language different and perferred over others depending on the job at hand.

“Right tool for the job” is another way to explain this. There are hammers, and mallets, and rubber hammers, and sledgehammers. They’ll all get that peg in the ground, but which is the best to accomplish the task as effectively as possible?

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