Underneath computers and their programs are programming languages, lines of code that can give you a headache just looking at them. But what are programming languages and how do they work?
What is a programming language?
In short, a programming language is how a computer programmer “talks” to a device. If you know how to “speak” one of these languages (and there are hundreds of them), you can create a program that can work. These can range from simple, such as a script to move files from one location to another, to complex, such as modeling a 3D world in a video game. Programming languages are the reason we use computers to do complex things. At their core, computers still work with binary code, also known as machine language, a set of parameters that determine what the computer does and how. You can think of a programming language as a layer on top of that, so humans don’t need to convert zero into one and back again.
This is a good thing: if we still have to program with binary numbers, it will take a long time to create even a simple script. Advanced programs will not be created at all, because getting all the zeros in the right palace will require an army. Programming languages, although difficult to learn and use, are the foundation of project management tools.
Levels of Language
Basically, programming languages fall into two categories: low-level languages and high-level languages. Low-level languages are so called because they are “closer” to the machine, they can speak to it directly. This includes machine language and assembly language, which are programming languages that are slightly removed from binary.
High-level languages are a step above low-level languages. They are remote from the machine, but human can read it. “Hungry” in this 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. It also works the other way around: you can type a command that the machine will execute.
Interpreted Speech
That said, it is important to note that the program is not perfect. When you type commands in a high-level language, you’re not telling the device what to do. Instead, you talk to a so-called interpreter, a program that is part of a language that translates commands into binary. You tell the interpreter what you want, and it tells the computer what you said, but in machine language.
An interpreter shares the difference between you and the machine, and each language has a different translation. Assembly languages are smaller because their commands also need to be defined, but they use something called an assembler instead of an interpreter because their commands are closer to “pure” machine language and therefore they don’t need enough. translation.
An interpreter is a piece of technology: you have to tell it some words to do its job of telling the computer how to move zeros and ones around. Instead of saying “move the blue box to the top right”, we need to enter a line of code that is understood by the interpreter, which varies by programming language. The interpreter then uses this input to tell the computer what to do.
Since natural language is difficult for computers and translators to understand, which can change and change without code, we use programming languages, languages that translators and humans can understand. The interpreter then passes it to machine language, creating a small daisy chain.
How programming languages work
The choice of the word “language” is also not accidental: as in human language, programming language has internal rules that prevent anything from going off the rails.
A programming language will have syntax, a set of rules about word order and word usage, just like in 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 get a different sentence: “Fred gave Gary a book”. It still makes sense, but if you mean “Gary Fred’s book” we have a problem on our hands.
Programming languages are no different: the correct one must go to the right place for a sentence – often called a “symbol” – to make sense. It’s just that programming languages use different methods to express themselves. Do it
Some things are the same: most programming languages use verbs, for example. In Python, which is often considered one of the easiest languages to learn, you can tell it to print a line of text. print(“Hello, world”)
In this case, the words “Hello, world” will appear on the screen. Of course, the law can be more complicated than that; many languages have mas
Of course, not everything makes a lot of sense at a glance: most of the code you will see contains many symbols and punctuation marks that you will not use in everyday speech. However, once you get them, they are much smaller than you might think. In human language, we can use different words to refer to different things. In English, for example, we call things like “ya” and people like “she” or “she”.
If you reverse them, the sentence will fail. Programming languages are not very different: brackets and parentheses simply indicate different programming languages. Change them and the sentences fall. Of course, these things can also change from language to language: a parenthesis in Python does something very different from what it does in Lisp, and something different in C. As in Human language, usage and meaning can change, some do. better language and some things. and others.
Which programming language should you learn?
So what is the best language to start learning? There’s a lot – and we mean a lot – of discussion between language advocates about what each language can and can’t do and which one is better. But the bottom line is that the best language really depends on the programmer and the question. As with human language, your thought process affects your thoughts and what makes sense to you.
If you want to be one of the few people who can “tell” machines and make them do what you want, you can check out Python, which has a good reputation for being easy to learn. If you want more of a challenge, you can check out C, which is the foundation of many operating systems. Whatever you choose, it’s fun to start thinking like a programmer.