What makes different programming languages “better” than others? Or more powerful? Why have different languages developed over time? Are they all based on the same thing?
In: 187
This is a lot of questions so I’ll answer them one by one.
1) Usually programming languages aren’t universally better, they are just better for a specific task. There are multiple ways to make a language and they have the advantages and disadvantages. For example, you can make a programming language that is easier to read but it can be harder to code more complex things.
2) More powerful usually means the language can do more things. Less powerful languages can usually still do the same things, you just have to code it yourself. More powerful languages have it already built in.
3)Different languages are developed because of the fact they have different strengths and weaknesses. Like I mentioned in the first answer, different languages have different advantages so people develop new languages that are optimized for the specific task they want to use it for.
4) They are all based on machine language if that’s what you mean. There is a specific code that a computer actually runs on but it is complicated and hard to read. Most programming languages are then built on top of this. They create a system that uses words and symbols that humans can easily understand as a stand in for the machine language. This is the programming language. There is then a compiler that translates it into the language the computer directly understands.
Some have built in features for making certain operations easier. Some have syntax that requires fewer characters/keystrokes to write the same expression in another language. Some are more strict than others, meaning some languages will let you get away with certain errors and continue to operate while some will stop running completely on the same error. Some require you to define certain details about your code in order to work, while others allow you to define things loosely and handle the details for you. Most of the things I listed are advantages to some programmers and disadvantages to others, depending on their projects and preferences
performance – some languages make it easier to build fast applications
terseness – some languages require less text, which usually makes them easier to read and debug
tool support – some languages have free, high-quality compilers and interpreters
They are all based on the same thing, kind of. They have to tell a specific family of processors what to do. But that’s done with 1s and 0s, and nobody’s got time for that shit. It can be done, but it ain’t fun and it ain’t fast.
So instead of using “machine language” people developed assembly language to make it a little easier for humans. The assembly language gets translated back to machine language by using a special-purpose computer program.
So you write a program and it gets turned into a simpler program by using a program. Why not take it a step farther?
Since assembly language still kind of sucks, people started creating higher-level languages that are much easier for humans to use. Over time, even the next higher level. Some of the older languages are kind of janky and aren’t used much any more. Humans do learn to improve things, and software tools are certainly no exception.
Different programming languages have different advantages and disadvantages. Other’s have gone into that.
Programming languages for digital machines all function to abstract the programmer from machine code. Machine code is a program written in 1s and 0s, but all programs have to eventually be written in 1s and 0s because it’s what the computer can read. Programming languages have compilers or interpreters to turn what a programmer has written into 1s and 0s. This is useful because it’s a lot easier for a human to understand a program written in a programming language than a program written in machine code. This allows a programmer to write even more complex programs that would take a superhuman mind to program before by constantly having to interpret information from machine code. When people say a language is powerful, it means that you can do more with it. You’re able to write more complex programs in less time. Some of choosing a programming language is preference and some of it is compatibility. There a programming languages specifically made for designing websites, for example. Sometimes it’s better to work with a certain framework or library that a programming language has. Sometimes you want more control over memory, and sometimes you’d rather let the compiler handle the memory management even if it’s less efficient.