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?

1.30K views

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

78 Answers

Anonymous 0 Comments

Cars are all designed to do the same thing: Transport people and cargo from one place to another. They are all generally based on wheels and feature a common control interface (steering wheel and pedals).

However, within the task of transporting people and cargo from one place to another, there is a lot of variation. How far are you driving? How expensive is gas? Do you care about looking cool? Does speed appeal to you? How much cargo do you need to carry? What type of cargo? How many people do you need to carry? Is range important? How developed are the roads around you?

And that is how, with the same general requirements, you get diverging types of cars, such as sports cars, minivans, sedans, pickup trucks, jeeps, and more. While one can do the job of another, generally, it will not be as efficient, or maybe it won’t be as safe. You can technically replace a transit bus with a motorcycle, but you will need a lot more of them, and you can expect insurance to go up. You can use a formula 1 car for your daily commute, but the average person has no idea how to drive one and probably won’t get very far.

Programming languages are very similar. They all serve the purpose of allowing a human to tell a computer to do something. If you know what you are doing and are not concerned about speed, ease of use, and safety, they are all essentially interchangeable. However, those factors – speed, ease of use, and safety mean that certain languages tend to be developed to serve certain niches, much like how cars tend to be developed to serve certain use cases.

Some programming languages are very good at giving you a lot of control over everything (C is an example of this, ). However a lot of this control can be very overwhelming at first. Other languages (Python) trade some of that control for user friendliness (in this case by automatically deciding how you want to store your numbers). In car-land, a formula 1 car allows you to do a lot of cool stuff, but all of the complicated settings and buttons mean that most people will opt for a normal vehicle.

Some programming languages are very good at allowing you to do things right away. Hot take, I like MATLAB for this. Press run, your code just runs. Type a statement into the terminal afterwards to append something you missed, it just runs.

C on the other hand is comparatively difficult to get running standalone as you need to run your C code through another program called a compiler, and then run it, potentially on another machine entirely… It takes a lot to get running, but it runs far faster once it starts.

A car example would be a dragster and a minivan. To start a minivan, you get in, turn the key, and you’re driving! If you suddenly find out you need to pick up a television, you just put the seats down and throw it in the back. If you’re joined by 7 people, chances are they will fit. However you won’t be driving very fast. It takes a lot of effort to start a dragster, and you can’t really steer much once you are going, but you will take off going extremely fast. You definitely won’t be picking up a TV, though.

There are a few other examples bouncing around in my head, but this post is already long enough.

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