If algorithms can be converted into code of any language, what is the point in having multiple languages?

316 viewsOtherTechnology

If algorithms can be converted into code of any language, what is the point in having multiple languages?

In: Technology

21 Answers

Anonymous 0 Comments

C and C++ are compiled languages – the readable code is portable, but the compiled executable (basically, after translating to a runnable program) is specific to a machine (honestly not sure what this entails. Specific to a model of CPU probably?). These two languages are famous for doing nothing for you automatically and making you do everything yourself, and in return it runs really fucking fast (if you don’t tell it to do something, it just won’t do it, meaning you save a lot of time and space).

Java compiles to “byte code”, but not an actual executable. When you run a “compiled” java “program”, it actually runs a CPU-specific interpreter, and then feeds the interpreter the byte code, meaning a “compiled java program” can run on any machine without further changes to the code. It’s a lot stronger than C and C++. The objects you create have a lot of bells and whistles attached and it will clean up its own garbage, but in return its slower than C and C++.

Python isn’t compiled at all. The python interpreter will just straight up run the human readable code. You don’t even have to explain to the program what the objects are and how to use them, it will figure it out itself. The language tries its best to hide as much of the machine from the programmer as possible, so the programmer can focus on the concepts and theories instead of trying to talk to the computer in a friendly way. Runs “very slowly”, much slower than C/C++ or Java, but because computers are a bajillion times faster than a human anyways, for a lot of applications it doesn’t matter.

Those are the three I was taught for my CS degree. They are among the common languages, but not the most common. There’s a ton of other languages out there and they all do something different.

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