• Programming language for the solution. Modern programming languages ​​and their use

    2) What is a programming language page 2

    3) What are programming languages ​​for? page 3

    4) What programming languages ​​exist pp. 4 – 7

    5) What is a compiler and interpreter page 8

    6) References page 9

    Introduction

    Until the mid-60s, computers were overly expensive machines that were used only for specific tasks and performed only one task at a time (the so-called. batch processing).

    The programming languages ​​of this era, like the computers they were used on, were designed for specific tasks, such as scientific computing. Since machines were expensive and only one task was performed at a time, machine time was expensive - so speed of program execution came first.

    However, during the 60s, the price of computers began to fall so that even small companies could afford them; The speed of computers kept increasing and the time came when they often began to stand idle without tasks. To prevent this from happening, they began to introduce systems with time sharing(time-sharing).

    In such systems, processor time was “sliced”, and all users in turn received short sections of this time. The machines were fast enough to make each user at the terminal feel as if they were operating the system alone. The machine, in turn, was idle less, since it performed not one, but many tasks at once. Time sharing radically reduced the cost of machine time because one machine could be shared by hundreds of users.

    Under these conditions - when power became cheap and available - the creators of programming languages ​​increasingly began to think about ease of writing programs, and not just the speed of their execution. “Small” (atomic) operations performed directly by machine devices have been combined into “larger”, high-level operations and entire structures that are much easier and more convenient for humans to work with.

    What is a programming language

    Programming language- a formal sign system designed to describe algorithms in a form that is convenient for the performer (for example, a computer). A programming language defines a set of lexical, syntactic, and semantic rules used to compose a computer program. It allows the programmer to determine exactly what events the computer will react to, how data will be stored and transmitted, and what actions should be performed on these under various circumstances.

    Since the creation of the first programmable machines, humanity has already come up with more than two and a half thousand programming languages. Every year their number is replenished with new ones. Some languages ​​are used only by a small number of their own developers, while others become known to millions of people. Professional programmers sometimes use more than a dozen different programming languages ​​in their work.

    Language creators interpret the concept differently programming language. Among the communities of places recognized by most developers are the following:

    • Function: a programming language designed to write computer programs, which are used to transmit instructions to the computer to perform a particular computing process and organize the control of individual devices.
    • Task: A programming language differs from natural languages ​​in that it is designed to transmit commands and data from a person to a computer, while natural languages ​​are used only for people to communicate with each other. In principle, we can generalize the definition of “programming languages” - this is a way of transmitting commands, orders, clear guidance for action; whereas human languages ​​also serve to exchange information.
    • Execution: A programming language can use special constructs to define and manipulate data structures and control the computation process.

    What are programming languages ​​for?

    The process of computer operation consists of executing a program, that is, a set of very specific commands in a very specific order. The machine form of the command, consisting of zeros and ones, indicates exactly what action should be performed. CPU. This means that in order to give the computer a sequence of actions that it must perform, you need to specify a sequence of binary codes for the corresponding commands. Machine code programs consist of thousands of instructions. Writing such programs is a difficult and tedious task. The programmer must remember the combination of zeros and ones of the binary code of each program, as well as the binary codes of the data addresses used in its execution. It is much easier to write a program in some language that is closer to natural human language, and entrust the work of translating this program into machine codes to a computer. This is how languages ​​designed specifically for writing programs arose - programming languages.

    There are many various languages programming. In fact, you can use any of them to solve most problems. Experienced programmers know which language is best to use to solve each specific problem, since each language has its own capabilities, orientation towards certain types of problems, and its own way of describing concepts and objects used in solving problems.

    All the many programming languages ​​can be divided into two groups: languages low level And high level languages.

    Low-level languages ​​include assembly languages ​​(from the English toassemble - assemble, assemble). Assembly language uses symbolic commands that are easy to understand and quick to remember. Instead of a sequence of binary codes of commands, their symbolic designations are written, and instead of binary addresses of data used when executing a command, symbolic names of this data chosen by the programmer are written. Assembly language is sometimes called mnemonic code or autocode.

    Most programmers use high-level languages ​​to write programs. Like ordinary human language, such a language has its own alphabet - a set of symbols used in the language. These symbols are used to make up the so-called keywords of the language. Each of the keywords performs its own function, just like in our familiar language, words made up of letters of the alphabet of this language, can perform functions different parts speech. Keywords are linked together into sentences according to certain syntactic rules of the language. Each sentence defines a certain sequence of actions that the computer must perform.

    A high-level language acts as an intermediary between a person and a computer, allowing a person to communicate with a computer in a way more familiar to humans. Often this language helps to choose correct method solving the problem.

    Before writing a program in a high-level language, the programmer must write algorithm solving the problem, that is step by step plan actions that need to be performed to solve this problem. Therefore, languages ​​that require a preliminary compilation of an algorithm are often called algorithmic languages.

    What programming languages ​​are there?

    Fortran

    Programming languages ​​began to appear in the mid-50s. One of the first languages ​​of this type was the Fortran language (English FORTRAN from FORmulaTRANslator - formula translator), developed in 1957. Fortran is used to describe an algorithm for solving scientific and technical problems using a digital computer. Just like the first ones computers, this language was intended mainly for carrying out natural science and mathematical calculations. In an improved form, this language has survived to this day. Among modern high-level languages, it is one of the most used in conducting scientific research. The most common variants are Fortran-II, Fortran-IV, EASICFortran and their generalizations.

    ALGOL

    After Fortran in 1958-1960, the Algol language (Algol-58, Algol-60) (English ALGOL from ALGOrithmicLanguage - algorithmic language) appeared. Algol was improved in 1964-1968 - Algol-68. Algol was developed by a committee in which included European and American scientists. It is a high-level language and allows you to easily translate algebraic formulas into program commands. Algol was popular in Europe, including the USSR, while the comparable Fortran was common in the USA and Canada. Algol had a significant influence on all later developed programming languages, and in particular on the Pascal language. This language, like Fortran, was intended for solving scientific and technical problems. In addition, this language was used as a means of teaching the basics of programming - the art of writing programs.

    Usually the term ALGOL means the language ALGOL-60, while ALGOL-68 is considered as an independent language. Even when the Algol language almost ceased to be used for programming, it still remained official language for publishing algorithms.

    COBOL

    In 1959 - 1960, the COBOL language was developed (English COBOL from COmmom Business Oriented Language - a common business-oriented language). This is a third generation programming language, intended primarily for the development of business applications. Cobol was also intended for solving economic problems, processing data for banks, insurance companies and other institutions of this kind. The developer of the first unified Cobol standard was Grace Hopper ( grandmother Cobola).

    COBOL is usually criticized for being verbose and cumbersome, since one of the goals of the language's creators was to make the structures as close as possible to the English language. (Cobol is still considered the programming language in which the most lines of code were written). At the same time, COBOL had excellent facilities for working with data structures and files for its time, which ensured its long life in business applications, at least in the United States.

    Different programming languages ​​and their areas of application. Lecture in Yandex

    We decided to devote our first post this year to a very basic topic, a lecture on which was given at the Small ShAD. It is attended by high school students who are interested in technology, hence the specificity of the presentation - the lecture will be especially interesting to those who are just starting to program and are thinking about what direction to develop. For them, Yandex has a course “Introduction to Programming (C++)”, which can be taken on the Stepic.org platform.

    Lecturer Mikhail Gustokashin is the curator of academic programs at Yandex, director of the center for student competitions at the Faculty of Computer Science at the Higher School of Economics. Mikhail has trained dozens of winners and prize-winners of the All-Russian Programming Olympiads.

    The lecture tells about what programming languages ​​there are, how they differ, how they appeared, and which ones are better and which ones are worse. At the beginning, we will talk a little about the history of languages ​​- how they appeared, how people began to program, how everything developed, what is happening now. The second part will touch on what tasks which language is suitable for, how to “choose your favorite language and enjoy life.” The lecturer will also talk a little about how, in his opinion, you can learn all this and then get a job.

    As always, below the cut is a detailed transcript of the lecture so that you can navigate its contents.

    History of programming languages

    Let's start from the beginning. In the beginning, computers didn't even have keyboards! That is, everything was very bad - they had neither a keyboard nor a screen, they had punched cards (these are little things with holes or no holes). Accordingly, either they stuck the pins there, or they shone a light there. If there is a hole (or vice versa not) - this meant a zero or a one. And programs at that time were written using machine codes - every operation on a computer (addition, subtraction, some more complex operations) had some kind of machine code. People themselves chose this code from a sign, all sorts of addresses in memory, they knocked it all out with their hands and put it into the reader - and it was all counted. Of course, the work of a programmer was probably not particularly interesting then - making holes - and with the development of science and technology, of course, they began to come up with all sorts of more “interesting” things. For example, assembler, which already made life somewhat easier.

    Well, how did he make life easier? Instead of remembering that there was some kind of “magic” code for the team, all sorts of words similar to “human” were used English language- some add or mov - and then registers or memory areas, variables with which these operations need to be performed were listed. But it is clear that this, in general, also required quite high voltage mind, to keep in our heads what register we have what, where what variables are, and what is happening in general. Why did this happen? Because computers were “stupid” and could not understand anything more “smart”. In fact, assembling machine code from assembler also requires time and memory (at that time, of course, there was little of it).

    Gradually, it became clear that developing such large complex programs was very difficult. The programmer's productivity in these teams was extremely low - that is, he wrote several lines a day (meaningful), and each line did not do anything special - some simple arithmetic operations. And people wanted to make languages ​​much more similar to human language, to English in particular, to make writing programs easier and more convenient. And off we go!

    Old and dead languages

    One of the first languages ​​was Fortran. By the way, it was also punched out on punched cards - there were special punched cards for punching out Fortran programs. But if you take this Fortran now, in my opinion, it is even somewhere between 50-60. appeared - and if you try to write something on it, you will be very unpleasant, I guarantee you! Modern Fortran is still alive, but is quite different from what it was before.

    Other languages ​​- now I’ll write one thing, which you’ve probably heard of only at various events where they talk about the history of programming - this is COBOL. It was a language for writing business applications. What are business applications? Some transactions in banks, something else, all of this was written in Cobol. Of course, it’s not very popular here. I think you will find it very difficult to find a Cobol programmer in Moscow. And somewhere not in Moscow - with even greater difficulty. But, surprisingly, just 10 years ago, more than half of all the code written by humanity was written in Cobol. And to this day, a significant part of all banking transactions are carried out using programs written in it (COBOL), and people still write something in it.

    There is also a “funny” language, it was called Algol (the 68th version, which characterizes the year of its creation). This is an algorithmic language. In general, they were able to do something there, but now we are not very interested in what they can do. And with this we can finish our excursion into antiquity and into relatively unused languages ​​and move on to what is still alive (and actively living).

    Old but living languages

    Algol was invented in Europe, and Fortran was used mainly in the States - there are no big differences. What trend is noticeable? At first everything was complicated and in order to write you had to be almost an engineer, an electrical engineer, to understand where which contacts are connected and something else for programming. Then you also had to sit with the pieces of paper and count the memory, look after it. And gradually everything became simpler, simpler, simpler and then even simpler for the programmer - to think as little as possible for a person, to do as much as possible automatically. Around the end of this period (the lecturer points to Algol and Kobol), languages ​​begin to appear that, in a sense, have “survived” to this day.

    BASIC. Perhaps some people still write something in it, at least I saw that in some institutions they teach in QBasic - there’s a blue window where “1989” is written. In general, he is “living with all his might”! It was invented as a language for non-programmers. At that time, a programmer was such a very specialized profession. And here they tell you: “Here we have a cool Basic language, and any reasonable person will take it and write a program on it - it’s easy.” Again, that BASIC and modern BASIC are a huge difference. All these lines numbered after 10, all sorts of GOTOs and other horrors - they no longer have anything to do with modern BASIC, and even to BASIC of 1989 they have little to do with it.

    Another funny story is the Pascal language, widely known in university circles, mainly in Russia and the countries of the former Soviet Union. It has been and continues to be used in surprising ways. educational language. In the rest of the world it is less common, but it is also alive and well. There is such a person as Wirth - he is a scientist, a theorist. He participated in the Algol discussion, he did not like what happened, and he came up with his own language - Pascal. And then the Borland company (and before that many other companies - Apple was involved, in particular) took it and ruined everything. He had a beautiful, coherent theory - “everything will be fine” - and they took it and stuffed it with what people needed to work. Well, it didn’t turn out as beautiful as he wanted.

    And finally... C was invented by engineers. If Pascal was invented by a scientist, then C was invented by Kernighan and Ritchie, they worked as engineers at Bell. How did this happen? At that time, it was impossible to write anything systemic in these languages ​​(the lecturer points to Fortran, COBOL, Algol). What is “systemic”? For example, an operating system, some drivers, something else. These languages ​​were intended for mathematical calculations, for business calculations, for all that. And everything else was written in Assembly. There were some languages, they are now dead, that is, the C language did not appear immediately from Assembly, but through some intermediate things.

    What's the point? Kernighan and Ritchie loved to play the Asteroids toy - a spaceship flies, and there are asteroids, he shoots at them, and they fall apart. They had a server where they played, but there were a lot of people there, and the toy was slow. And they discovered somewhere in their office that they had some kind of computer that no one was using. But there was a problem - it was of a different architecture, and the game was written in Assembly.

    They rewrote it, of course, even added some features to play on it. But this gave them the idea that they should rewrite it under new architecture every time is not very smart. And they decided to write a high-level language that would be suitable for system programming, that is, in which it would be possible to manage memory, in which it would be possible to understand where things lie and how to access these pieces of memory. And so the C language appeared, which had a huge influence on everything that followed. All of them (the lecturer points to Algol, Fortran and other mentioned languages) had a great influence, but C - just yes...

    Accordingly, it was the main language in Unix, an operating system that was even more popular at that time than it is now. And around the 80s, the situation was something like this (the lecturer shows Basic, C and other mentioned languages). Let's say that all this has already slowly died out in our country (the lecturer erases mentions of Assembler, Fortran and Algol)... And in the 80s, computers became smaller, smarter, cheaper, and people wanted all sorts of strange things to make life even better, to live even more fun.

    Languages ​​from the 80s

    One of the first oddities was that it was a C++ language. The C language has a huge number of shortcomings (well, just generally huge) - you can do everything in it, including shooting yourself in the foot, shooting yourself in the foot with fiction, in the other foot, shooting one foot in the other foot, in general - what whatever you want to do. But at the same time, some architectural things are done there quite difficult - again, as in Assembly, we have to keep track of where we are, what and what memory we have allocated; It’s there all the time “flowing” somewhere, this memory - that is, we allocated it, forgot to delete it, deleted the wrong thing, went beyond the memory limits, in general - we raked in a bunch of problems.

    C++ was originally created as a set of additions to the C language that would make development easier. At that time, object-oriented programming became fashionable and people decided that everything could be described in the form of a hierarchy, that is, you have a ball (abstract), you inherit from it a soccer ball, a volleyball, another abstract ball. It was fashionable then that “we are now writing everything in the form of some kind of hierarchy, and everything will be fine, life will get better, everything will be fine and that’s it.” C++, in a sense, implemented this object-based approach - it was not the first object-oriented programming language, but it became quite popular and all sorts of features began to appear in it. At the same time, C++ retained almost full compatibility (at that time) with the C language; a program written in C was successfully compiled as C++ in 99% of cases and even worked the same way. This was intended to make it easy to switch from C to C++.

    In addition to the object approach (in C++), a standard template library (STL) quickly appeared. I think that at school, those who were still learning Pascal discovered that, firstly, you don’t have built-in sorting (in the ancient, blue Borland Pascal, now it already exists in modern versions) - there is an example (source) of sorting, you can copy and paste it. But if you want to sort integers here, here you want real numbers, and here strings that can be compared with each other, you had to write three different sorts that do exactly the same thing, they just have different types data. This is not very good, and the templates that did not immediately appear in C++ greatly alleviated this problem. That is, you had an abstract program that successfully sorted something that could be compared with each other.

    Scripting languages ​​from the 90s

    But time did not stand still; in the 80s, many interesting things happened. But somewhere around the turn of the 80s and 90s, computers became so good that it was possible to do very strange and very inefficient things. In particular, these were scripting languages ​​that were not compiled into machine code, but rather interpreted. BASIC was also interpreted at some time, but these scripting languages ​​were intended mainly for text processing - these are, for example, Perl, Python (it was not very famous then), PHP, Ruby - these are the scripting languages ​​that in one or another to a different extent, they still live (they all managed to appear before 2000, even much earlier).

    Let's go over them a little, because these are specific things and are now used in many places. What is the idea? If we don't compile, then we can allow a lot more. For example, a program can look at its code and somehow use it; she knows what is happening in her and due to this she can do a lot of interesting things.

    Perl was intended for text processing - in those days there was so much memory in computers that you could stuff some text there and do something useful with this text (for example, count words, do some kind of search). But, in my opinion, it was designed by people who were a little crazy, because there is a joke about it: “Any set of characters written is a valid Perl program.” In my opinion, you can only write on it, you cannot read it. When I look at Perl code and try to understand something, I don't understand anything. Maybe if I knew him better, I would understand something, but as I heard from those people who still know how, they say that it’s easier to rewrite it again. That is, the programs turn out to be short and it’s really easier to rewrite them from scratch than to figure out what’s there and fix it.

    Around that time, in the mid-90s, the Internet appeared. At first it was mail, websites with static HTML, but people wanted to add some kind of dynamics there, so that everything would happen dynamically, some forms could be filled out, guest books could be made, and something else. Accordingly, this required some kind of interaction, they came up with a protocol, how it interacts, and, most importantly, the generation of these static (conditionally) pages that will be “spitted out” to the user in response to his request.

    In general, nothing other than Pearl was suitable at that time. It was possible to write a handler in pure C or C++ bad idea. And for lack of anything better, at that time (and for quite a long time) Pearl was the popular language for web development. Of course, the scale cannot be compared with what is happening now.

    PHP appeared as... by accident. One person stopped doing this quite quickly - he made his own page, he had some kind of guest book, something else, some other things. And he wrote a set of some macros for Perl that were similar to C, because he knew how to use C, simply because it was so convenient for him. And I called it Personal HomePage. He shared it and said: “People, look at what I wrote, everything here is much clearer than in Perl and you can edit it.” And people liked it.

    Then he gave up this business. In general, as a result, this PHP began to live and became over time much more popular than Perl. But this “birth trauma” of his (conceived as a set of macros for Pearl) played quite a cruel joke on him. The language turned out strange. That is, it developed on its own, no one designed it, no one administered the development process (neither a company nor any person), but there were many groups, each of which sawed what they liked. As a result, the functions are named differently, there’s not even a style, everything is underscored, basically haphazard, the settings are here and there, and how all this will work is not very clear. But you can sit down and write in PHP in two hours, because that’s how it was intended.

    Python and Ruby: Ruby is less popular now, Python is somehow better “planed”, let’s talk about it later. It is clear that in those days these were (the lecturer points to Perl, Python, Ruby, PHP) highly specialized languages ​​for highly specialized purposes. In general, no one wrote any system programming, no business logic in them at that time and now not much does it.

    Compiled languages ​​from the 90s

    We will go around the same times, but in the other direction. At that time, we used C++ for almost everything that needed to be written, not for the web, not for text processing, but for just applications, for operating systems, for toys - in general, for anything. But C++ is actually a terrible language. Why? Because, firstly, it inherited all C problems due to backward compatibility. You could still kill yourself there with a million different ways, the same ones that were in C (naturally, new methods were added in C++). At the same time, if you write everything well and correctly, as was intended by the authors of C++, then, of course, it was no longer possible to kill yourself using the old C code methods, and it seems like there are fewer of them. However, it had a very strange, peculiar object model. Splitting a program into modules, into pieces of some kind, generally came from C (if you know how to write include in C or C++ - in fact, it was intended as a way to simply insert the library text into your program, in the end, when you write a bunch of includes, you have everything - if it’s “primitive”, as it was at the very beginning - everything is inserted into one file and then it all takes a terribly long time to compile, because the same Pascal, Virtovsky, was much more thoughtful in this regard, the later ones. versions have become even better.

    In general, C++ has a lot of disadvantages. The programmer had to be highly qualified to write in C++, and such programmers were expensive (and training, and something else, that is, it is difficult to find programmers on the market, they need to be paid a lot, well, in general this is not the case... ). And our computers are counting faster and faster, they are becoming cheaper, people are buying new computers and want more apps, more toys for the phone, in general - more joy.

    This is how Java appeared. There is also a rather funny story about how this language got its name. There are programmers there, they drink coffee all the time and at that time it was fashionable to drink coffee, which grew on the island of Java. The language was conceived as a language for built-in devices, in particular for a coffee machine. This is how the name came about...
    What started with her, what was good about her and why did she gain so much popularity? First, they got rid of Sishnoi's legacy, completely. There are no signs, much fewer ways to shoot off some part of your body and break everything. Secondly, they introduced much more recent ideas in terms of object model- that is, C++ appeared much earlier than Java and used a more archaic, “wild” object model. Well, here (the lecturer points to Java) it was already more thought out then, and in theory people thought, and in practice they applied and made everything much cooler.

    And finally, third. Our Java programs were compiled not into machine code, but into code for a virtual machine. That is, you had a virtual machine (VM) JVM - Java. Your programs were assembled into some kind of intermediate representation and then, with the help of this machine, they were already executed. What did it give? Firstly, it slowed down, secondly, it ate up memory with terrible force, thirdly, it was portable anywhere (theoretically) - even to a coffee maker, even to a coffee grinder, even to a computer, even to a mobile phone. On the one hand, this is good, that is, you just wrote an implementation of a virtual machine, then you run your Java programs everywhere. But, on the other hand, it’s bad that the same phone then had little memory, low performance, and all this also began to slow down and slow down.

    But this is not even the main thing for which the language was invented in the first place. The Java language was invented to reduce the qualification requirements for programmers. That is, worse programmers can write good programs in Java because it doesn't allow you to write bad programs - there are no tools there to write bad programs. There you can only write good programs. Well, in the understanding of the creators of the language.

    That is, if in C, in C++, in Python, in anything, we can create some kind of terrible garbage dump out of our project, where we have everything mixed up, assembled for hours, and something else. It’s also possible to create a garbage dump in Java, but this requires some effort. That is, by default, it’s not a “garbage dump”, other problems arise, that something has been inherited and inherited - in general, for one meaningful line you get ten not very meaningful ones. But, such a moderately qualified programmer can write fairly high-quality code.
    We're almost at the end. For us, the next thing that appeared was .Net (dotnet), and in particular we are interested in C# (almost the same thing [the lecturer points to Java], that is, there are differences in details, if you choose between them, look where they pay more money).

    And one more thing - JavaScript. Has nothing to do with the Java language, appeared in the same year - the word was fashionable, they licensed trademark to use.

    What is the main thing you need to pay attention to? (The lecturer draws arrows from C++ to Java, .Net, C#, JavaScript and PHP). To write a simple program in one of these languages, and in many others - if you know C++, you generally don’t need to know anything else - you write in C++, and then add dollars at the beginning, something else do little things and it starts working on anything (the lecturer points to the languages ​​to which the arrows from C++ were assigned). That is, they are extremely similar in some simple things. If you are solving some school problems, educational problems, or something else (you are not designing a large project - you have one file that reads numbers, displays numbers in the console, and does something else), then there is almost no difference between these languages. It is clear that JavaScript and PHP are specialized, everything is a little different for them. But here (the lecturer points to Java and C#) there is very little difference at all.

    Since then, all sorts of other interesting things have appeared, but it is not clear whether they will live or die successfully. What are they using now, for what purposes?

    Selecting a language depending on the task

    Let's say you are faced with the task of writing a driver for a video card. What language will you use today? (Shout from the audience: Java!) Why... Java is great, but why not Ruby or PHP? (The lecturer speaks sarcastically.)

    Low Level Programming

    If you are writing something low-level, then the best choice is C, but actually I have heard (but not seen) that C++ is used for this. But I have little faith in this, because in C you can clearly control - since you gave so many bytes of memory, that means there will be so many. And in C++ (STL) how is a string implemented? Well, somehow it was implemented. And in the end we don’t know how and what is happening there; maybe we will run out of memory on our video card or something else will happen. Therefore, C still lives and does not die, such system programming tasks still exist - write an operating system, write drivers, write something else - C is great for this. In addition, now all sorts of devices are appearing (the Internet of Things is promised to come soon) that run on batteries (and, naturally, there will be millions of them, everything will be covered with this Internet of Things), they should be very cheap and have very little electricity consume. Accordingly, there will be 2 KB of memory, a 5 kHz processor, and it’s clear that you can screw in some kind of virtual machine or scripting language It won't work out in the near future - which means you'll have to write something in C. And even now, for example, computing on a video card (OpenCL or some other technology) - they don’t come up with a new language to write programs for them - they do C with some big restrictions. Just because people already know how, why learn something new? Formally, this is probably also, in a sense, C.

    Web programming

    Let's say you want to write new Facebook(social network). What will you write this on? (People from the audience are talking about HTML and CSS.) HTML and CSS are design, and we want it to be possible to add photos, friends, and leave comments there.

    For the scripting part - that is, what will happen on the client side - this is JavaScript. Moreover, sometimes JavaScript is generated in another language and sent (it happens that the script is generated... because it is sometimes easier to process some changes in the logic).

    Surprisingly, it is written in PHP - and Facebook, and many other large projects. Of course, they had to write some of their own things so that it would still work normally, and not in a “clunky” way, but they did it. In principle, it more or less doesn’t matter what you write in, but I don’t recommend Perl. Here and now, of course, no one writes anything for the web from scratch. Everyone is writing some kind of framework or something else. Online store? We downloaded a framework for an online store - and that’s it, we wrote an online store.

    Programming for business

    Next you want to write some boring application for a bank. Or, for example, do you have anyone who sells SIM cards? Perhaps you have ever bought a phone or something else and been told: “The system is hanging, we can’t do anything.” What will you use to write such an application? (Shout from the audience about Python) You can’t write this in Python, what are you saying?! There is no need to write anything for business in Python. Why? Because when you write something in Python, it is impossible to detect a significant number of bugs during the writing process. Python is dynamically typed in every possible way, and in general you can hide a bug in such a way that it will pop up in such a situation that you won’t even be able to understand what these crooked users did there, that everything is broken for you. That is, in Python it is better to write small scripts for yourself - you understand what is happening there and what is being done. Well, or something that you don’t mind throwing away: you want to roll out something before your competitors, so what if it breaks every now and then. You wrote in Python and that's it - you captured the market. And if you write something for a long time, for example, some kind of banking application (so that it approves loans, something else) - you write it in Java. Because it’s a serious matter, papers, money, documents, something else, but you can’t screw it up so much that everything breaks, otherwise people will be offended - their money went away and didn’t get anywhere, because in some kind of moment the string turned into a number or vice versa. So, it means that you methodically take it in Java and write, write... Well, or on .Net, such situations, in principle, also happen. There, of course, you can also run into problems, but still the likelihood of this is somewhat lower.

    Programming for the army, aerospace industry

    Now imagine that they decided to send you to the Moon on a rocket. What would you rather be used to write the code that controls the rocket engines? Let's see. This, probably (the lecturer shows Perl, Python, PHP, Ruby), is not worth it - it slows down, something else is happening, and in general I would not agree to fly on such a rocket. In C++? To be honest, I wouldn’t trust it either, because in C++ there are too many ways to kill yourself. When you're out there somewhere in space, it's not very good.

    Maybe in Java? It seems that everything there is quite reliable and the architecture is good, no wild types, no unnecessary trips beyond memory limits. Let's say the most crucial moment has come, and our Java has decided to collect garbage for us. We need to land, slow down, and she’s like: “No, garbage is going.” In general, not very good either.

    Honestly, I would prefer if this program was written in Pascal. Of course, I don’t really like Pascal, but somehow in such matters it would be very cool.

    Using multiple languages ​​for software development

    Well, what needs to be said in general about modern languages. Now many projects do not live in any one language, that is, some of them live in one language, some in another, and some in a third. For example, if you have some kind of web application that processes wild amounts of information, calls to disks (not even to databases, they are so huge that even a database there cannot handle any already written one) are probably written in some kind of then low-level C, to write wildly quickly to disk and all that. Naturally, it’s not worth writing the entire project in C. Maybe there is some kind of intermediate logic written in Java that calls C functions for quick calls. Well, the frontend (what the user looks at), of course, is already written in something, in some scripts, in something that is directly executed by the browser (JavaScript). And all this lives together and interacts successfully.

    When developing some applications, even large ones, sometimes what do people do? They take it and write a prototype in Python (how it will all work), sketch it out, think through some kind of architecture. Writing on it is really very fast - they threw together a prototype, experimented with it and said: “Wow! That’s so cool!” And they completely rewrote it. It would seem that they did the job twice, which made it take twice as long (well, one and a half). But no! It often turns out that this method is not bad, because if you write something right away, for example in Java, and then decide: “No, let's refactor, change the architecture completely and all that,” then you will spend 10 times more time . Such things also exist and live.

    Conditions for the success of any programming language

    Now let's talk about why some good-looking languages ​​did not survive, or live in a very limited space. When Wirth saw what bad companies Apple, Borland and all that did to his Pascal, he came up with an even better language - Oberon. It was just wildly minimalistic - that is, there were very few commands (Strings? Why do we need strings? We'll make an array of characters!). Well, something didn’t work out for him, to the extent that it could have worked out.

    One more thing. The American military asked them to develop it too cool language, on which everything works and everything can be written. The result was a rather monstrous Ada language, in which, however, they still write something, but again - only for the military.

    What's the problem? Why some languages ​​like Python, which no company supported in the beginning, took over the market. PHP, which is also poorly designed, also took over the market (most of it) on its own. And all sorts of billions of dollars were invested (the lecturer points to Ada) and did not go anywhere, nothing happened. What is this connected with? This is due to the fact that there is no infrastructure around these languages. That is, the language may be excellent, but as long as there is no documentation, as long as there is no community that can answer questions (on Stack Overflow) and, finally, most importantly, as long as there are not a large number of libraries, the language does not take off. That is, for example, you wanted to write a website on Oberon. What is it, why not? And the hassle begins... You can’t set up your own web server on Oberon to test it lightly, you can’t connect any libraries, because Oberon doesn’t have them. And all this is done through some crutches, the strength goes away, and in general you give up and write your website in pure C instead of Oberon. And those languages ​​that live well are those that know how to use libraries from other languages. The same Python in those places where it slows down. Well, in general, all sorts of standard things like sorting and something else are written in C, and it (Python) can interact with them.

    Java also has a Java Native Interface. This is essentially C, that is, there (in my opinion, they always want to ban it, but it seems they haven’t banned it yet) these languages ​​can interact with already existing libraries (mainly C). And because of this, they take it and work. The idea I'm trying to convey to you is clear, right? Don't write in languages ​​that don't support the C library. Well, if you want to use something cool. Well, gradually they (the languages) acquire their own infrastructure. And they live somehow well.

    Programming language and career guidance

    Now let's talk about how to understand what you want in life. What are the coolest things? You can do some systems programming, right? It’s great for you to count these bits, you want to launch quadcopters, some kind of cameras, and do something else. Then, probably, C is your choice.

    If you want to write, maybe not the most interesting applications in life, but it’s cool for you to design them, think about it all and earn a lot of money for sitting and being bored most of the time (you have to pay for this if you’re good at miss), here they are - Java, .Net. You go to work in some bank, write, go to work at nine in a white shirt, get a good salary and write according to the recommendations of the best Java developers, .Net sheep and all that...

    If you want to write some applications, some kind of browser, some kind of toys, or something else, then C++ is great. If you want to write websites, here they are, languages ​​of your choice (the lecturer shows Perl, Python, PHP, Ruby), there is not much difference. The only thing is that PHP will die before Python, so if you are lazy to learn new things, then learn Python. You won't notice much of a difference, but you'll last longer.

    What's happening with Ruby is also unclear. Well, you can do PHP if you’ve already learned it, fortunately it’s so simple that it won’t take that long to relearn.

    And finally, there is another area of ​​application of programming languages ​​- this is when a non-programmer uses them. Let's say you are a mathematician, physicist, chemist, analyst, anyone, and you need to quickly calculate something, analyze some data (for biologists, for example, how many arctic foxes live on the Commander Islands). You can put all this into a table in Excel or analyze it with something. Python is also good for this, it can work with text and there are a lot of libraries, statistical and all that. If you want to do some kind of Machine Learning, process some data, make predictions, then this is also done in Python the fastest way now. True, it should be noted that the tasks are very different. For example, if you want to trade on the stock exchange instantly in conditions where quotes change all the time, then no matter how cool Machine Learning you write in Python, people who have it written in something faster will have time to buy everything before Everything will be counted for you, even if their algorithms are worse. So even these machine learning tasks (some of them) require high performance(and extremely high), and, accordingly, other languages.

    The only way to understand what you want is to try everything. Now I will say it as one of the visions of how you can try everything. How to become a programmer, and a happy one? So. WITH clean slate let's start. Here you are studying mathematics, Russian language and other compulsory and optional subjects at school, and your knowledge in the field of programming is reflected on the board (the lecturer points to an empty board) on at the moment. And you want to become a happy person, do what you love, earn a lot of money and not deny yourself anything and be happy.

    One way to achieve this. There are, of course, all sorts of inspiring stories about people who did not go to university at all, or dropped out and became billionaires, company owners, and so on. But it should be noted that most people who may not have become billionaires, but also live well, still graduated from university at some point.

    What is the situation with admission to university (are you currently studying at school)? While you are in school, you need to understand that the next step is to enroll and take care of it. Pass the Unified State Exam or win the Olympiad. On the Unified State Exam you can use Pascal, C++ (including pure C), Python (I will not mention them further). At the Olympiad there is the same Pascal, the same C++, the same Python (we will now talk about its problems) and, most often, there is Java. There are other things that happen depending on the Olympics, but that’s not the point.

    What does the graph of language distribution at the All-Russian Olympiad in Informatics look like? People who participate in the All-Russian, the coolest Olympics, what do they write in? It looks like this (here it means Pascal, and here it’s about 2000, and here it’s about zero, here it’s C++, and here it’s 2015).

    In 2000, almost no one wrote C++. 15 years have passed, and almost no one writes in Pascal, despite the fact that Pascal is modern. This is a language that can do almost everything the same. It’s just that everyone has become too lazy to study this, every new trend, and they continue to write everything in Borland Pascal, which of course can’t do anything. In C++, people write some algorithms (STL) to sort - great, they wrote sort() and that’s it. On Pascal, on regular, on the old one - this is a problem. We wrote some kind of set (it was needed) - great, we wrote it in C++, but in Pascal it was again a complete pain. Of course, you can do this with new Pascals, but they generally cost money. You may not have noticed this, but it is true.

    There is also Java, but Java has a lot of letters. It is for large projects, but for small one-time programs it turns out very bad, because there are a lot of extra letters. But some people also write, you can learn to write on it. But it’s not on the Unified State Exam and the majority will still have to take the Unified State Exam.

    What is best for the Unified State Exam? For the Unified State Exam, it is best (if you don’t know anything and they don’t teach you anything at school) to learn Python. Some exam problems can be solved perfectly on it. At the Olympiad, in general, it turns out that C++ is used, because Python is very slow, not everything is solved there.

    Thus, you have studied some small subset of the language and some algorithms (possibly) and solved many problems in order to receive a diploma from your Olympiad and enter the university to receive a higher education.

    I will now talk about how we structure the course at HSE, in what order the languages ​​are taught, how they are studied in applied mathematics and computer science at the Faculty of Applied Sciences, which we do together with Yandex. In the first semester - Python (not in full, approximately as you should learn in school) and C++ (already wider, much wider than it is usually taught in schools). Let me tell you right away so that you don’t be scared, if you suddenly want to enroll, you’ll say: “What, I already know all this, why should I go somewhere to study? I'd rather go somewhere else." For those who already know how to program well, there is an opportunity to immediately move on to studying algorithms, and in a fairly theoretical preparation. We don’t look at them now, this (points to the board) is for those who are intermediate or not at all programmers.

    In the first semester, the basics of Python are taught, just so that people learn how to program and so that no one is too offended. Python is rarely taught in schools; most people come with knowledge of Pascal or C++. Mostly even Pascal, if this is a mass school. Well, so that no one is offended, everyone learns a new language (as if they are in equal conditions). And C++ simply because from C++ you can then go anywhere.

    Then comes the Algorithms course and a separate course project. Classic algorithms with implementation. It’s not that we took something in theory and calculated the complexity. At the lecture we took it, calculated the complexity, at the seminar we took it and implemented the algorithm. A project is where students make something complete. For example, one of the projects was: count... Let's say you have a lot of apartments in Moscow and you understand: “Oh, I have a lot of extra things, I’ll rent out some. And they set a certain price, and for some reason no one wants to rent an apartment from you - it’s probably too expensive. Or they set some price, they immediately took it from you and you think: “Oh, I probably sold it cheaply” - and you also get upset. That is, it was necessary to calculate how much it costs to rent an apartment? You enter the data - it creates an estimate for you. Such a site, which consisted of several things: take sentences, parse them, apply some kind of (probably) simple machine learning algorithm and make a beautiful web face in which you can select something, enter something, some meters, some number of rooms, number of saunas, number of jacuzzi in your apartment and roughly estimate the cost. That is, some kind of finished, not very complicated thing. Here it means (the lecturer points to the course on algorithms) such a core C++, with console I/O. Well, here (the lecturer points to the inscription “project”) something under the guidance of a mentor, perhaps with databases, perhaps with text parsing and something else.
    Then there is the third semester - this is a course called “Computer Systems”. There's just a little assembly language to understand (very little) and then something similar to pure C and interaction with operating systems, systems programming essentially. And the project for the seminar is also something on the topic of all sorts of network interactions, quite low-level: develop some kind of utility, for example rsync (synchronization, perhaps you know. In pure C, more or less, write an analogue of rsync, which you will have over the network synchronize folders with all file accesses and so on).

    And finally, the fourth. I don’t even know what to call it, it’s such a vinaigrette of technologies necessary for real development, for example, web development. That is, this practical application databases, again something similar to what was done in the project (the lecturer points to the 2nd year project) but more in-depth. That is, these are more or less specific things, practical programming. In parallel with this comes every theory, and here they also do science.

    And after two courses, people go off to do whatever interests them, because this thing covers the basics of programming quite widely and by this time people already understand that they don’t want to do it computer systems in no case (they didn’t like system programming, for example), but they want to work on some theoretical algorithms, calculate difficulties, come up with some new things, distributed or something else. Or, on the contrary, they think that they don’t have much here ( the lecturer points to the line of the first course with Python and C++) went, then ( lecturer points to third course line, with systems programming) - I don’t like it, counting bytes and setting all sorts of restrictions on reading and writing, making streams, threads and something else. And in accordance with this, people choose a direction and study. That is, in principle, so that you do not develop “duckling syndrome” - you were the first to see your Pascal and now say “Pascal is power”; or more advanced - you saw C++ and started talking about everyone that C++ is strong, but everything else is not very good.

    Now we need to look at this (the lecturer points to the list of courses on the board) more broadly - this is one of the methods that was chosen, in particular at HSE (it recently appeared, so it is quite modern). There are other ways to get acquainted. In other good universities, the order is a little different and other accents are placed. But they also try to introduce people to everything they have.

    How to look for a job as a programmer

    You are ( the lecturer points to the list of courses) did everything, studied at the university, did something else for two years more productively and you need to go to work. How to choose something for work? Firstly, you have become familiar with everything, gone deeper somewhere and already know what you love. You have to choose what you love, naturally. Because if you love, you put in the effort, you will have motivation and in general everything will be fine. Because it’s not just about money, it’s about making it interesting and enjoyable for you. Well, do you want to get in? cool company, get a job. What kind of person would I personally like to see? Let's say a hundred students come to me - should I hire two or one. Why do they come, I don’t understand at all, who they are, what they are, how they are? At best, they will show me the diploma they received at the university, and I will say: “Wow! This is a cool diploma, but this is not so cool!” And I could be wrong, by the way. Maybe the person had a lot of free time and learned much better.

    What would be great? Firstly, some open source project that you wrote from start to finish. Preferably, if I’m making some kind of infrastructure so that data can be quickly read, or something else, then, of course, I would be interested in having something open source written for me. They didn’t make a website, but something on the topic. Why am I interested in this? I can look at your code, I can see how often you committed, I can see how you reacted to bugs from users, bugs from developers who use it - everything is recorded, I look at everything and think: “Wow, this bug hasn’t been there for two years now.” closed, here you responded impolitely to the user, here’s something else - I won’t take it.” That is, this is your personal project.

    Next, what else would be cool? I'd like to see how you did teamwork. That is, you come to me for an interview and say: “The guys from the university and I have made some good application. I was making a database there, they were making some kind of mobile application there, and we also had a guy working there, a girl designer, a boy on technical support. There were five of us and we made a cool project.” Well, I see that it’s really your project, I say: “What’s yours?” I look at the code again and understand that you know how to work in a team with people.

    A programmer is not someone who sits alone (indie) in a garage, somewhere with the lights off, doesn’t talk to anyone, grows a beard and writes. There is still some interaction with people. With a boss, for example, who may sometimes swear at you (bosses, they are like that, are not always kind). And I see that you know how to work with people and it makes me happy if you have some kind of good team. Even if it’s not good, it’s better than not having one.

    What else would I personally like? If you proved yourself in big projects. For example, you committed something into the Linux kernel, if you are into systems programming, and fixed some bug. That is, they showed that you know how to read someone else’s code and know how to make some changes to it. I look: “Oh, really, you figured out something complicated and fixed some bugs!” And I begin to be very happy about this. Because I have... well, I don’t know... my programmer quit because his competitors offered him a higher salary, and I urgently need someone to fill his place - with you. I see that you only wrote from scratch, but you don’t know how to read and edit someone else’s code, and I get upset.

    And finally, depending on the specific position, there are various other things. If you are getting a job as an analyst, I would like you to solve data analysis problems on Kaggle. If you are applying for some algorithmic things, I would like you to sports programming some algorithms have been done. And finally, if you have thought about the profession, read how interviews are conducted, you have seen that some people express great dissatisfaction: “I came, and they asked me what my hobby was. I sit like an owl and don’t answer because I don’t have a hobby,” and they think that HR’s do this. In fact, they are trying to understand how friendly and adequate you are. If you are unfriendly and inadequate, then no matter how genius and workaholic you are, a tough specialist with great knowledge, it will be difficult for the team to work with you, and you will not be able to complete the project alone. In addition, even if you pull it out, you can imagine what the burden is for the company. What if you come tomorrow and say: “Increase my salary 10 times, otherwise I’ll leave you.” It is clear that companies do not want to find themselves in such a situation. Therefore, cultivating adequacy and goodwill in oneself is as important (at a minimum) as developing some professional skills.

    To summarize, what can we say? Which languages ​​are good and which are bad? Well, within a certain group of languages, for example between Ruby, Python and PHP, what should you choose? Of course, the correct answer is Python, but in fact the difference between them is in the number of bugs allowed, in the number of something else - 5%, well, maybe 10%. That is, if you already have a ready-made project written in PHP, then no one in their right mind would say: “Let's rewrite everything in Python.” They will say: “Let’s hire more PHP developers and continue writing in PHP.” Great, that's a good choice. It’s clear that if you suddenly decide to write some kind of project, then it might be wise to choose Python now. Although, that also depends. Maybe you have a lot of cheap PHP developers on the market, and Python ones are expensive, and you think: “Yes, the technology is cooler, but I’ll save money on ready-made developers.” And everything is great, you already come and work there.
    How to choose between Java and C++? Yes, roughly the same thing happens. I think that by the time you decide in which language to start a new big project, you will have gained knowledge in your professional field and will be able to do right choice. Now you don't have to make that choice yet, and so I advise you to do what you like.

    The basics, as I already said, the very, very basics of programming (what is a function, what are if’ics, for’ics, arrays, something else) can be learned in more or less any language. For example, in C++, since there are a lot of similarities to it, and there are the least specifics in it (at this level), and there are the least amount of extra letters to write. Well, then, when you learn some complex architectural things, you will learn and you don’t need to worry too much about it. That is, the main thing is to try, look for what you like, and when you realize that it’s already 4 o’clock in the morning, and you’re sitting and writing for fun, because you like it - probably at that moment it’s clear that you’ve found yours .

    It's no secret that programmers are among the highest paid specialists around the world. Russia is no exception. Good programmers are also appreciated here. And if you're interested in a fast-growing and lucrative career, you might want to learn and become a programmer.

    To help you with this choice, I have collected data from various job search sites. While this is not a comprehensive list, it does provide insight into the most in-demand programming languages ​​(demanded by employers).

    9 most popular programming languages ​​of 2016

    It is not surprising that SQL tops the list, since it is used almost everywhere and in a wide range. Database technologies such as MySQL, PostgreSQL and Microsoft SQL are used on servers of large and small businesses, hospitals, banks, universities, etc. Indeed, almost every computer and person with access to a database eventually touches SQL. For example, everyone Android phones and iPhones have access to the database SQL data called SQLite and many mobile applications Developed by Google, Skype and Dropbox use it directly.

    1. Java

    The tech community recently celebrated Java's 20th anniversary. It is one of the most widely adopted programming languages, used by nearly 9 million developers, and runs on 7 billion devices worldwide. It is a programming language used to develop all native Android applications. The popularity of Java developers comes from the fact that the language has long-term compatibility, which ensures that older applications will continue to work now and in the future. The only difficulty is that this language is quite difficult to master, especially for beginners.

    JavaScript is another one of the most popular and powerful programming languages ​​and is used to bring web pages to life by making them interactive. For example, JavaScript can be used to add effects to web pages, display pop-up messages, or create games with basic functionality. It's also worth noting that JavaScript is a scripting language World Wide Web, which is built into all major web browsers by default, including Internet Explorer, FireFox and Safari. Almost every site includes some JavaScript elements, which adds to the demand for JavaScript developers. In recent years, JavaScript has also started to be used as the basis of Node.js. server technology, which, among other things, allows for real-time communication.

    C# (pronounced C-Sharp) is a relatively new programming language developed by Microsoft for a wide range of applications. enterprise applications, which run on the .NET Framework. The evolution of C and C++, the C# language is simple, modern, safe and object-oriented.

    C++ (pronounced C-plus-plus) is an object-oriented programming language general purpose, based on the C language. Developed by Bjarne Stroustrup at Bell Labs, C++ was first released in 1983. Stroustrup maintains an extensive list of applications written in C++. The list includes Adobe and Microsoft applications, MongoDB databases, most of Mac OS/X and is the best language for studying the performance of mission-critical applications such as "twitch" game development or audio/video processing.

    Python is a general-purpose programming language that was named after Monty Python. Python is simple and easy to read (for those who know English). It is a great language for beginners and seasoned professionals alike. There are many programming courses available for Python, 8 out of 10 computer science departments teach coding with using Python. Due to the use of Python in education, there are many libraries created for Python related to mathematics, physics, science processing, etc.

    Created by Danish-Canadian programmer Rasmus Lerdorf in 1994, PHP was not intended to be a new programming language. Instead, it was created to serve as a set of tools to help its creator maintain it personal page on the Internet (in PHP). Today, PHP is a server-side scripting language that can be used to create web pages written in HTML format. PHP is a very popular language because it is easy to use for new programmers, but it also offers many advanced features for more experienced programmers.

    Like Java or the C language, Ruby is a general-purpose programming language. Ruby on Rails is used to write web applications and also provides integration with the web server and database. Ruby on Rails has many positive qualities, including fast development and a wide range of libraries. It is used by many companies ranging from small startups to large enterprises. Hulu, Twitter, Github, and Living Social use Ruby on Rails for at least one of their web applications.

    In 2014 year Apple decided to invent their own programming language. The result is Swift, a new programming language for iOS and OS X developers. The developers claim that many parts of Swift are familiar to them from their experience working in C++ and Objective-C. Many companies in the West, including American Airlines, LinkedIn and Duolingo, have switched to Swift, and the language will become increasingly popular in the coming years.

    Any master has a full set of tools, each of which is suitable for a specific task. Likewise with programming, there will never be just one language, and each language will evolve and improve over time to keep up with innovation.

    That's why if you're interested in becoming a developer, it's important to become proficient in multiple programming languages ​​so you can be versatile and adaptable, and continue to learn languages ​​throughout your career.

    When you're trying to figure out which programming language to start learning, you'll likely come across the terms "high level" and "low level". People talk about high-level and low-level programming languages ​​all the time. But what exactly does this mean? And what does it mean to learn to write code? Let's start with the definitions of each.


    “High” and “Low Level” programming languages

    In this article I will talk about “high” and “low level” languages. But there are no special criteria to determine this. Just keep in mind that this largely depends on your perspective. If you are a C programmer, Java may seem quite high-level. If you're used to Ruby, Java may seem like a low-level language.

    Machine code and low-level languages

    Whether a language is considered high-level or low-level (or somewhere in between), it's about abstraction. Machine code has no abstraction - it contains individual instructions that are transmitted to the computer. And since machines only deal with numbers, they are represented in binary (although they are sometimes written in decimal or hexadecimal notation).

    Here is an example of machine code:

    In machine code, operations must be specified precisely. For example, if a piece of information needs to be retrieved from memory, machine code will have to tell the computer where in memory to find it.

    Writing directly to machine code is possible, but very difficult.

    Low-level programming languages ​​add a bit of abstraction to machine codes. This abstraction hides specific machine code instructions behind declarations that are more human readable. Assembly languages ​​are the lowest level languages ​​next to machine code.

    In machine code you could write something like "10110000 01100001", but assembly language can simplify this as "MOV AL, 61h". There is still an almost one-to-one correspondence between what is written in assembly language and the instructions given to the machine.

    Moving into more popular programming languages, you end up with something like C. Although this language is not as low level as assembly language, there is still a strong correspondence between what is written in C and machine code. Most operations written in C can be filled with a small number of machine code instructions.

    High level programming languages

    Like lower-level languages, higher levels cover a wide range of abstractions. Some languages, such as Java (many consider it an intermediate programming language), still give you a lot of control over how the computer manages memory and data.

    Others, like Ruby and Python, are very abstract. They give you less access to lower-level functions, but the syntax is much easier to read and write. You can group things into classes that inherit characteristics, so you only need to declare them once.

    Variables, objects, subroutines, and loops are important parts of high-level languages. These and other concepts will help you tell the machine a lot of things with short, concise statements.

    While assembly language has a nearly uniform mapping between its instructions and machine code instructions, a higher-level language can send dozens of commands with a single line of code.

    It's important to note that "high-level programming languages" can include anything that is more abstract than assembly language.

    Which language to study: low or high level?

    This is definitely general question among new and aspiring programmers. Which programming languages ​​are better to learn: high-level or low-level? As with many programming questions, the question of high-level and low-level programming languages ​​is not so simple.

    Both types of languages ​​have important advantages. Low-level languages, because they require little interpretation by the computer, tend to be very fast. And they give programmers a lot of control over data storage, memory, and retrieval.

    However, high-level languages ​​are intuitive and allow programmers to write code much more efficiently. These languages ​​are also considered "safer" because there are more safeguards that prevent the coder from issuing poorly written commands that could cause damage. But they don't give programmers the same control over low-level processes.

    With that in mind, here is a list of popular languages ​​on a scale from low to high:

    • JavaScript
    • Python

    Of course, this is partly subjective. And it only includes a tiny fraction of the available languages.

    But this should give you some idea of ​​what level the languages ​​you're interested in are at.

    What do you want to do?

    When deciding which language you will learn, your first question should be: what do you want to program?

    If you want to program operating systems, kernels, or anything that needs to run at top speed, a lower level language may be a good choice. Most Windows, OS X, and Linux are written in C and C-derived languages ​​such as C++ and Objective-C.

    Many modern applications written in higher-level languages ​​or even domain-specific languages. Python and Ruby are especially popular for web applications, although HTML5 is becoming more powerful. Languages ​​like Swift, C#, JavaScript, and SQL have their own strengths and weaknesses.

    I was recently reading a thread on a programming forum and came across an interesting suggestion: study both levels at once. You'll gain a deeper understanding of the types of abstractions that make a higher-level language more efficient.

    Of course, learning two languages ​​at the same time is not easy, so you may want to spread out your learning a little. And choosing two languages ​​that are most similar can be helpful.

    Again, we'll go back to what I said earlier: choose a language based on what you want to do. Do some research to find out what languages ​​people use in their field. Then use this information to choose a high and low level language and start learning them.

    You'll soon see the parallels and you'll gain a much deeper understanding of how programming works.

    Focus on the end, not the means.

    There are many criteria you can use to choose a programming language. One of the criteria is high and low level. But in almost every case, the criteria you should use is what you want to program.

    Your project could benefit from a low-level language. Or it can be much more effective at a high level. It's up to you to choose the right tool for the job. Focus on your goal and choose the right language every time.

    Do you have experience with high and low level languages? Do you prefer one over the other? Share your thoughts in the comments below!

    PROGRAMMING LANGUAGE AND ITS TYPES

    A programming language is a formal sign system designed to write computer programs. A programming language defines a set of lexical, syntactic and semantic rules that define appearance programs and actions that the performer (computer) will perform under its control.

    A high-level programming language is a programming language designed to be fast and easy to use by the programmer. The main feature of high-level languages ​​is abstraction, that is, the introduction of semantic constructs that briefly describe such data structures and operations on them, the descriptions of which in machine code (or other low-level programming language) are very long and difficult to understand.

    Low-level programming language (low-level programming language) is a programming language that is close to programming directly in the machine codes of the real or virtual (for example, Java, Microsoft .NET) processor used. A mnemonic notation is usually used to denote machine instructions. This allows commands to be remembered not as a sequence of binary ones and zeros, but as meaningful abbreviations of words in human language (usually English).

    LOW LEVEL PROGRAMMING LANGUAGES

    Early computers had to be programmed using binary machine codes. However, programming in this way is a rather time-consuming and complex task. To simplify this task, low-level programming languages ​​began to appear, which made it possible to specify machine commands in a form more understandable to humans. To convert them to binary code were created special programs- translators.

    Fig.1. An example of machine code and its representation in assembler

    Translators are divided into:

      compilers - turn program text into machine code, which can be saved and then used without a compiler (an example is executable files with extension *. exe);

      interpreters - turn part of the program into machine code, execute it and then move on to the next part. In this case, an interpreter is used every time the program is executed.

    An example of a low-level language is assembly language. Low-level languages ​​are focused on a specific type of processor and take into account its features, so in order to port an assembly language program to another hardware platform, it must be almost completely rewritten. There are also certain differences in the syntax of programs for different compilers. True, central processors for computers from AMD and Intel are practically compatible and differ only in some specific commands. But specialized processors for other devices, for example, video cards and phones, contain significant differences.

    Advantages

    Low-level languages ​​create efficient and compact programs because the developer has access to all the capabilities of the processor.

    Flaws

      A programmer working with low-level languages ​​must be highly qualified and have a good understanding of the microprocessor system for which the program is being created. So, if a program is created for a computer, you need to know the device of the computer and, especially, the device and operating features of its processor;

      the resulting program cannot be transferred to a computer or device with a different type of processor;

      significant development time for large and complex programs.

    Low-level languages ​​are usually used for writing small system programs, device drivers, interface modules with non-standard equipment, programming specialized microprocessors, when the most important requirements are compactness, speed and the ability to directly access hardware resources.

    Assembly is a low-level language that is still widely used today.

    HIGH LEVEL PROGRAMMING LANGUAGES

    The first high-level programming language is considered to be the computer language Plankalkül, developed by the German engineer Konrad Zuse back in the period 1942-1946. However, a translator for it did not exist until 2000. The world's first high-level language translator is PP (Programming Program), also known as PP-1, successfully tested in 1954. Translator PP-2 (1955, 4th in the world translator) was already optimizing and contained its own loader and debugger, a library of standard procedures, and the PP translator for the Strela-4 computer already contained a linker of modules. However, the widespread use of high-level languages ​​began with the advent of Fortran and the creation of a compiler for this language (1957).

    High-level languages ​​strive not only to make complex programming problems easier to solve, but also to make software easier to port. The use of a variety of translators and interpreters ensures that programs written in high-level languages ​​communicate with different operating systems and hardware, while their source code ideally remains unchanged.

    This kind of isolation of high-level languages ​​from the hardware implementation of the computer, in addition to many advantages, also has disadvantages. In particular, it does not allow you to create simple and precise instructions for the equipment used. Programs written in high-level languages ​​are easier for the programmer to understand, but are less efficient than their counterparts created using low-level languages. One of the consequences of this was the addition of support for one or another low-level language (assembly language) to a number of modern professional high-level programming languages.

    Examples: C, C++, C#, Java, Python, PHP, Ruby, Perl, Pascal, Delphi, Lisp. High-level languages ​​are characterized by the ability to work with complex data structures. Most of them have integrated support for string types, objects, file I/O operations, etc. The disadvantage of high-level languages ​​is larger size programs compared to programs in a low-level language. Therefore, high-level languages ​​are mainly used for developing software for computers and devices that have a large amount of memory. And different subtypes of assembler are used for programming other devices where the size of the program is critical.

    Imperative languages ​​are based on several important ideas, including the representation of actions as mathematical formulas, the concept of data type, and the structural transformation theorem.

    A program in an imperative language is built from functions (subroutines). Assembly language programs can also consist of subroutines and this is nothing new, but high-level languages ​​allow you not to think about such issues as organizing calls, transmitting source data and returning results. The description of a function consists of a name, a list of parameters (initial data), the type of result and the actions leading to obtaining this result. One of the functions of the program is the main one, its execution is the work of the program.

    A simple example is a function that calculates the sine of a number. It can be called sin, its input data consists of one real number, the result is also a real number obtained by summing a segment of a known infinite series (or executing the fsin command of a mathematical coprocessor).

    The set of actions that can be performed inside a function is very limited. It consists of evaluating formula expressions, calling other functions (which is not a separate action - a function call is often included in an expression), assignments, branches (a group of actions that are performed only if some condition is true) and loops (a group of actions that are performed repeatedly, the number repetitions depends on some condition). Actions can be nested within each other. It may seem that the set of branches and loops is too small, but this is not so. It has been proven that any algorithm composed of functional blocks (at a low level - arithmetic commands and data transfer commands), conditional and unconditional transitions can be converted into an equivalent algorithm composed only of structural blocks - functional blocks, branches and loops with condition checking in end. This statement was formulated in the paper by Corrado Bohm and Giuseppe Jacopini, “Flow diagrams, turing machines and languages ​​with only two formation rules” (Communications of ACM, Volume 9 / Number 5 / May, 1965).

    If intermediate results need to be stored somewhere to perform the necessary actions, special declarations containing variable names and possibly other information are placed inside the function. The addresses of the RAM cells will be assigned to them automatically. In some languages, functions may also contain constant and type definitions. In Pascal-like languages, a function is like a program and can include definitions of not only constants, types and variables, but also other functions.

    A data declaration is a list of named objects. These objects are called variables. In a number of languages, the type of a variable must be specified, which determines the amount of memory required for its placement and the set of operations in which it can participate. But this is not necessarily the case; there are languages ​​in which the type of a variable is not specified and can change during program execution.

    Typically, programming languages ​​provide a fairly limited set of predefined variable types and tools for creating new types. Some of the following types are predefined:

      natural and integer numbers of various sizes;

      real numbers;

      symbols - letters, numbers, arithmetic signs, etc.;

      character strings;

      boolean values;

      pointers

    Actions on data can be performed using functions and operators.

    In the C language, for example, symbols, strings and boolean values. Its type char is actually a short integer and allows arithmetic operations.

    New types are formed by combining into a single whole several elements of the same type (an array, each element has a serial number) or elements of different types (a structure, each element has its own name). For example, complex numbers are not defined in most languages, but they can be defined:

    In some languages ​​(for example, in C++), operators can also be defined for created types, which allows you to use variables of these types in the same way as variables of predefined types.

    There are other ways to create new types. For example, in Pascal it is possible to create:

      range types (by specifying a range of values);

      enumeration types (by enumerating possible values);

      set types

    Variables of set types can be used to store information about a set of properties of any objects. Something similar can be done using variables of an integer type, whose set bits indicate the presence of the corresponding properties. Apparently, using sets is more resistant to programmer errors.