A programming language is a language that people use when developing software to tell a computer what to do. They come in many forms, but most programming languages rely on an interpreter that translates the human-readable language into binary so the computer can put the instructions into action.
At the foundation of computers and their programs are programming languages, weird-looking lines of code that are likely to give you a headache just looking at them. But what are programming languages and how do they work?
What are programming languages?
In short, a programming language is the way a computer programmer “talks” to a device. If he knows how to “speak” one of these languages, and there are hundreds, he can create a program that can perform tasks. These can range from the simplest, like a script that moves a file from one place to another, to the most complex, like rendering a 3D world in a video game.
Programming languages are the reason we can do complex things with computers. In essence, computers still work in binary, also called machine language, a system in which zeros and ones determine what the computer does and how. You can think of programming languages as a layer on top of this core, so humans don’t need to toggle zeros into ones and vice versa.
This is a very good thing: if we still had to use binary for programming, it would take a long time to create even a simple script. Advanced programs will probably never be made, since getting all the ones and zeros in the correct palace would require an army of people. Programming languages, while difficult to learn and use, are essentially labor-saving devices.
Broadly speaking, programming languages fall into two categories: low-level and high-level languages. Low-level languages are so called because they are “close” to the machine, they can talk to it directly. This includes machine language and assembly languages, which are programming languages that are only slightly removed from binary.
High-level languages are one step above low-level languages. They are further away from the machine, but humans can read them. “Readable” in this case means that if you know the language in question, you can look at a few lines of code and figure out what’s going on. This also works the other way around: you can write commands which will then be executed by the machine.
That said, it should be noted that the programming isn’t as straightforward as that. When you write commands in a high-level language, you’re not telling a device what to do. Instead, you are talking to a so-called interpreter, a program that is part of the language that converts a command to binary. You tell the interpreter what you want, and it in turn tells the computer what you said, but in machine language.
The interpreter bridges the gap between you and the machine, and each language has a different interpreter. Assembly languages are a bit strange in that their commands also need to be interpreted, but they use what is called an assembler instead of an interpreter since their commands are more related to “pure” machine language and thus they do not need a full translation.
The interpreter is a finicky bit of technology: it needs to be spoken to in a certain way in order for it to do its job of telling the computer how to move zeros and ones. Instead of saying “make the blue box go to the top right”, we need to enter a line of code that the interpreter understands, which varies depending on the programming language. The interpreter then takes this input and tells the computer what to do.
Since natural language is too difficult for computers and interpreters to understand, something that may change with the no-code revolution, we use programming languages, languages that can be understood by both interpreters and humans. The interpreter then outputs it to machine language, creating a little daisy chain.
How programming languages work
The choice of the word “language” wasn’t made by accident, either: Just like in human languages, programming languages have internal rules that keep everything from going off the rails.
A programming language will have a syntax, a set of rules related to the order and use of words, just like in a human language. For example, in English you can say “Gary gave Fred a book.” In this sentence, you know exactly who gave what and to whom; change the words and you get a different sentence: “Fred gave Gary a book.” That still makes sense, but if you say “a book he gave to Gary Fred” we have a problem on our hands.
Programming languages are no different: the correct bits must go in the correct places for a sentence, usually called a “line”, to make sense. It’s just that programming languages use different ways to express themselves.
Some things are the same: many programming languages will use verbs, for example. In Python, which is generally considered one of the easiest languages to learn, you can tell it to
In this case, the words “Hello, world” will appear on the screen. Naturally, the commands can get much more complicated than that; most languages have a massive set of verbs that can be used to perform all sorts of actions.
Of course, not everything makes that much sense at a glance: most of the code you’ll encounter has a lot of symbols and punctuation marks that you wouldn’t use in everyday speech. However, once you understand them, they are less rare than you think.
In human language, we can use different words to denote different things. In English, for example, we denote objects with “it” and people with “she” or “he”. If you change these, a sentence would fall apart. Programming languages aren’t too different: brackets and parentheses just indicate different classes of action. Change them and the sentence falls apart.
Naturally, these things can also change between languages: a parenthesis in Python does something completely different than what they do in Lisp, which is also different from C. Just like in human languages, the usage and meaning can change, making Some languages are better at certain things than others.
What programming language should you learn?
So which language is the best to start learning? There’s a lot, and we want to say much—Of discussion between fans of different languages about what each language can and cannot do and which is better. But the bottom line is that which language is better really depends on the programmer in question. As with human languages, your opinion is affected by your thought patterns and what naturally makes sense to you.
If you want to be one of the few who can “talk” to machines and make them do what you want, you can check out Python, which has a reputation for being easy to learn. If you want more of a challenge, you can check out C, which is the base for most operating systems. Whichever you choose, it’s a lot of fun to start thinking like a programmer.
RELATED: Learn to code with these amazing apps and websites