The first step in programming: choosing a language. Development of programming skills using the Maple package when teaching computer science at a specialized level

💖 Do you like it? Share the link with your friends

At the end of the week before last, a short speech took place in Moscow, where he told aspiring geeks about which language they should start their professional journey with and which future career they should strive for with the appropriate knowledge.

You can find some details of this meeting in the comments to the post, but for now let’s try to find out here: so which language should you learn first?

Old school

The first computer science lessons, teachers with a creaking in their hearts allow children to approach school computers to teach them the first programming language of their lives. 15 years ago, in most cases it was the procedural languages ​​Basic or Pascal, but if you were very lucky with the teacher, you could also learn C at the same time.

Let’s leave the latter out of the picture for now and figure out whether it’s good to start learning with highly limited languages. The advantages are obvious: simple syntax, similar to regular English language, and the opportunity to learn the basics of programming in just a few hours. But there is also a minus: the lack of real practical application without studying further development these languages ​​(Visual Basic and Object Pascal). And even in this case, you will be far from developing full-fledged modern applications.

So if you are still very young and circumstances are not forcing you to choose a future profession, then procedural languages ​​are an excellent choice. It is best to train, as they say, on cats. But if you want to start earning money tomorrow, then... However, more on that a little later.

Modern school

As you probably know, many modern schoolchildren begin their journey into programming with some simplified versions of “big” languages, such as Scratch, Blockly or Logo. In general, the advantages could be rewritten from procedural languages, if not for one “but”: these languages ​​and applications built on their basis are an entertainment service for children.

That is, the only thing that can be learned from such programming is the general structure of the program, the concept of loops and operators. This means that if you are already 12 years old, then forget about these children’s languages, it’s time for you to enter the world of adults.

Quick start with perspective

Let's say that, having discarded all preludes, you want to immediately start learning one of the popular programming languages, at the same time learning all the basics of programming. Then you only need to answer one simple question: what exactly do you want to do? If you program hardware, then there can’t even be a discussion here: the answer is C, that is, the C language. It combines everything a beginner needs: simple syntax, great opportunities both for continuing to work in this environment and for further retraining in “ not an iron profile. At the same time, in almost any large retail store of electrical goods you can find debugging boards, robotics starter kits and other delights for a beginner.

If you consider the web to be your calling, then you need to start your journey as standard with HTML and CSS. This will allow you to create static pages and get a rough idea of ​​what you will have to deal with. Next, it is highly recommended to take up Python. Firstly, because this language is really easy to learn. Secondly, according to some data, Python is the most popular language, if we take into account only student statistics since 2011. Thirdly, the capabilities of this language are such that today you use it to create a web (like DropBox or Google), and tomorrow you start developing a game (Civilization IV).


Hard to learn, easy to fight

Keeping with the web theme, you can choose JavaScript as your first programming language (in fact, the third after HTML and CSS). This is exactly what they did in computer science classes 15 years ago, and there was a very definite meaning to it: static pages with the addition of literally 4-5 lines have an active component, which increases the motivation to work in this direction. Moreover, performance does not depend on the browser or operating system. And this is not to mention the prospects for further development towards Node.js.

You can also start your journey on the web with PHP or Ruby, but if you have never done programming, then it is better to follow the path of least resistance and leave these two languages ​​for future study. Compare at the same time.

And finally, to application development. Three ways: Java, Swift, C#. The desire to start your programming education with them is a very serious challenge, which in the absence of hard work may turn out to be stupid, because each will require several months of intensive study. However, prospects can also serve as an incentive, be it a successful career in the mobile field (Java - Android, Swift - iOS) or gaming (C#+Unity).

One of the first problems that seems very important is: “Which language should I choose to learn programming?”

Before I answer this question, I will say that it doesn't really matter which programming language you choose to start with. It is not at all necessary to try to “save time” and learn a “useful” language. Professional programmers speak not one, but several programming languages; in addition, this field is dynamic and the situation is constantly changing - there is no point in looking for a tool that you can use for the rest of your life. Each task has its own language. Of course, many languages ​​solve the same problems, so another selection criterion is familiarity with the language. In other words, you use what works and what you know.

To learn the basics of programming, you need to choose languages ​​that are suitable for this task, i.e. will be quite simple to begin with, have rich capabilities, and allow you to get quick results. To learn programming, I can recommend several options: VBA, Python, JavaScript, Pascal ABC.

Let me take a closer look at the advantages and disadvantages of these options.

VBA = Visual Basic for Application is a language for creating macros that is included in Microsoft Office and some other programs. Excel is very convenient to use. Press Alt+F11 and... go! If you already have MS Office, then you don’t have to install anything - everything is already there to get started. VBA is a serious and “adult” language that is widely used to automate work in Excel and other programs. Main advantage: the fastest result! You can do something useful while still learning!

Python is a scripting language. Its characteristic feature is that it was created by one person. The language is so elegant and beautiful that it is then difficult to start working with “classical languages ​​for learning” (C++, Pascal / Delphi), they seem unsightly and inconvenient. Python is used for web programming and for writing code snippets for games. Python is used in the same areas as PHP, Perl, Ruby, etc. Main benefit: elegance and rich features for all levels of programmers.

JavaScript is a language used to bring web pages to life. It runs in the browser, i.e. on the client side. Scripting languages ​​(PHP, Ruby, Python,...) work on the server side and create a web page. After loading into the browser, two tools are responsible for the operation of dynamic elements - JavaScript and Flash. Main advantage: can be used when creating your own website. UPD: You can write applications for smartphones in JS+HTML5 (all platforms), Google Chrome and VKontakte.

Pascal ABC— a learning environment based on the Pascal language. Convenient to use for initial programming training, which is what it was created for. You cannot create your own complete programs. Includes a problem book, often used in universities and very often in schools. Pascal is the main language for the Unified State Exam in computer science. The latter is the main advantage.

Surely, there are other convenient environments and programming languages ​​for teaching the basics. Send us names and arguments in favor of this or that system and I will include them in the review.

Let me remind you that the main thing in choosing a language for learning the basics of programming is the availability of books on this language, the availability of tasks (they are universal) and, preferably, a person who knows this language so that you can consult with him.

At our school, at the first stage of training, we use VBA (if you already have Microsoft Office on your computer) or Python (if you don’t have Ms Office or you have Linux on your computer). I repeat once again: it is not the language that is important, but the tasks that you solve in it.

Topic No. 4 Programming language: evolution, classification

(O.L. Golitsina, I.I. Popov “Fundamentals of algorithmization and programming” pp. 38-45)

Evolution of Programming Languages

In the development of instrumental software(i.e., software used to create software in any problem area) five generations of programming languages ​​(PL) are considered. Programming languages ​​as a means of communication between a person and a computer have improved their characteristics from generation to generation, becoming more and more accessible to non-professionals.

The first three generations of language were characterized by a more complex set of reserved words and syntax. Fourth generation languages ​​still require a certain syntax when writing programs, but it is much easier to learn. Natural languages ​​currently being developed will form the fifth generation and will make it possible to determine the necessary procedures for processing information using sentences of a language that is very close to natural and does not require special syntax.

Generations of Japanese

YAP first generations were a set of machine instructions in binary (binary) or octal format, which was determined by the architecture of a particular computer. Each type of computer had its own language program, the programs on which were suitable only for of this type COMPUTER. The programmer was required to have a good knowledge of not only machine language, but also computer architecture.

Second The generation of language languages ​​is characterized by the creation of assembly languages ​​(assemblers, macroassemblers), which allow the use of mnemonic symbolic designations (names) instead of binary and other machine instruction formats. While a significant step forward, assembly languages ​​still remained machine-dependent, and the programmer still had to be well acquainted with the organization and functioning of the hardware environment of a particular type of computer. At the same time, assembly programs are still difficult to read, time-consuming to debug, and require great effort to transfer to other types of computers. However, even now assembly languages ​​are used when it is necessary to develop highly efficient software (minimum in volume and with maximum performance).

Third The generation of PL begins with the appearance in 1956 of the first high-level language - Fortran, developed under the leadership of J. Backus at IBM. In a short time, Fortran becomes the main language used for solving engineering, technical and scientific problems. Initially, Fortran had very limited means of working with symbolic information and the input-output system. However, the constant development of the language has made it one of the most common languages ​​on computers of all classes - from micro- to supercomputers, and its versions are also used for computing facilities of non-traditional parallel architecture.

Soon after the Fortran language, such now widely known languages ​​as Algol, Cobol, Basic, PL/1, Pascal, APL, ADA, C, Forth, Lisp, Modula, etc. appeared. Currently, there are over 2000 different high-level languages.

Languages fourth generations have a pronounced non-procedural character, determined by the fact that programs in such languages ​​only describe what is done, and not how to do it. In programs, relationships are formed rather than sequences of steps for executing algorithms. Typical examples of non-procedural languages ​​are languages ​​used for artificial intelligence tasks (for example, Prolog, Langin). Because non-procedural languages ​​have a minimal number of syntactic rules, they are much more suitable for use by non-professional programmers.

The second trend in the development of fourth-generation languages ​​is object-oriented languages, based on the concept of a program object, first used in the Simula-67 language and which subsequently formed the basis of the well-known Smalltalk language. A software object consists of data structures and algorithms, with each object knowing how to perform operations on its own data. In fact, different objects can use completely different algorithms when performing actions defined by the same keyword (the so-called polymorphism property). For example, an object with complex numbers and arrays as data will use different algorithms to perform the multiplication operation. Object-oriented Pascal Basic, C++, Smalltalk, Simula, and a number of other programming languages ​​have such properties.

The third direction in the development of fourth-generation languages ​​can be considered query languages ​​that allow the user to obtain information from databases. Query languages ​​have their own special syntax, which must be respected, as in traditional third-generation languages, but at the same time easier to use. Among query languages, SQL has become the de facto standard.

And finally, the fourth direction of development is parallel programming languages ​​(modification of the Fortran language computer, Oscam, SISAL, FP, etc.), which are focused on creating software for computing facilities of parallel architecture (multi-machine, multiprocessor environments, etc.), in contrast from third generation languages ​​focused on traditional single-processor architecture.

To the currently intensively developing fifth generation includes languages ​​of artificial intelligence, expert systems, knowledge bases (InterLisp, ExpertLisp, IQLisp, SIAL, etc.), as well as natural languages ​​that do not require the development of any special syntax (natural languages ​​with limited capabilities are currently successfully used - Clout , Q&A, HAL, etc.).

Classification of programming languages

In order for a computer to solve problems compiled by a person, it must sequentially execute the instructions of some algorithm program. The set of such instructions aimed at solving a specific problem is called computer program. But that is not all.

The computer does not understand the natural language of a person, but only understands its own language - machine code. As for the programming language, it, using fixed notation systems and rules, allows you to describe algorithms and data structures that will subsequently be translated translator into machine code.

All programming languages ​​can be divided into low-, high- and ultra-high-level languages.

Languages low level - This is a means of writing instructions to a computer using simple orders and commands at the hardware level. Such a language depends on the structure of a particular computer and is sometimes called a machine-oriented language. This language is poorly suited for human use, because a program written in this language is a sequence of zeros and ones, and there is little chance that a complex task will be programmed correctly. To simplify programming, a symbolic coding language (autocode, or assembly language) was developed. A program written in such a language is closer to humans, but still requires the programmer to have extensive knowledge in this area.

Next group - high level programming languages. These are languages ​​that allow a task to be described in a visual, easily understandable form. Their distinctive feature is their focus not on the command system of a particular computer, but on the system of instructions characteristic of recording algorithms of a certain class. High-end programming languages ​​include BASIC, Fortran, Algol, Pascal, C, etc.

TO ultra-high-level programming languages Algol-68 can be attributed, in which an attempt was made to formalize the description of the language, which led to the emergence of two types of programs: abstract and concrete. The first type of program - abstract - is created by the programmer, concrete - is derived from the first. There is an assumption that with this approach it is fundamentally impossible to generate a syntactically (and in practice, semantically) incorrect specific program.

The study of languages ​​often begins with their classification. The determining factors of classification are usually not strictly fixed. To demonstrate the nature of a typical classification, we will describe the most frequently used factors, give them conventional names and give examples of PL for each of the classification groups.

Elements of programming languages ​​can be considered at the following levels:

alphabet - a set of characters displayed on printing devices and screens and/or entered from the terminal keyboard.

vocabulary - a set of rules for the formation of chains of characters (lexemes) that form identifiers (variables and labels), operators, operations and other lexical components of the language. This also includes reserved (forbidden, keyword) words of a language, intended to denote operators, built-in functions, etc. Sometimes equivalent lexemes, and dependencies on a language, can be denoted by one or several alphabetic symbols.

syntax - a set of rules for the formation of language constructs, or sentences of language - blocks, procedures, compound operators, conditional statements, loop operators, etc. A feature of the syntax is the principle of nesting (recursiveness) of the rules for constructing structures. This means that an element of the syntax of a language in its definition directly or indirectly in one of its parts contains itself. For example, in the definition of a loop operator, the body of the loop is an operator, a special case of which is the same loop operator;

semantics - the semantic content of constructions, language sentences, semantic analysis - this is a check of the semantic correctness of the construction. For example, if we use a variable in an expression, then it must be defined earlier in the program text, and its type can be obtained from this definition. Based on the type of the variable, we can talk about the permissibility of the operation with this variable. Semantic errors occur when operations, arrays, functions, operators, etc. are used inappropriately.

Translators

A program written in any programming language is a source program. The peculiarity of such programs, as we remember, is that they consist of instructions that are understandable to humans, but not understandable to the computer processor. In order for the processor to perform work in accordance with the algorithm written in the original program, this program must be translated into machine language - processor command language. This translation of a program is called broadcast, but it is being executed special programs- translators.

There are three types of translators: interpreters, compilers and assemblers.

Interpreter - A translator that translates the program text step by step (command by command) and immediately (that is, in parallel) executes the translated command of the source program.

Compiler translates the text of the program into a module in machine language, then the program is rewritten into RAM and only after that is executed by the computer processor. It is with the use of translators of this type that a program in many programming languages ​​is translated into machine code. Therefore, let's look at it in a little more detail.

The operation of the compiler is illustrated schematically in Fig. 1.6.

Number 1 in the diagram indicates a syntactic control block for program text, number 2 indicates a machine code generator.


If the compiler's machine code generator has translated the source text of the program into the required form, it means that there are no syntax errors in the program text, but this does not mean that there are no errors in the algorithm. You can verify the correct operation of a program only by testing it, that is, by processing the results obtained during the program’s operation.

The last type of translators is assemblers. They are designed to translate a program written in assembly language (autocode) into a machine language program.

All translators, regardless of their type, solve the following main tasks:

Perform analysis and check the syntax of the translated program;

Generate machine code for the program;

Allocate memory for the output program.

Today I wrote an answer to Nina Shumilina from Tver, to a question about Python as the first programming language at school.

She quoted Konstantin Polyakov, the conclusion of his article in the September issue of Informatics:
For these reasons, the author is inclined to support the opinion of I.A. Bitch: Python is good for professional programmers, but using it as your first programming language may not be a good decision. As teachers who teach in Python admit, those who learned to program in Python do not want to switch to other (lower-level) languages. Having taught schoolchildren to sort arrays by calling the sort method, it is then difficult to explain why entire volumes have been written about sorting algorithms. And this can lead to the emergence of a galaxy of “Python-only programmers” who are not ready to overcome additional restrictions in order to improve the efficiency of the program. In fact, the teacher finds himself in a situation that is well described by the phrase “Python has such capabilities, but you can’t teach it like that!” (E.V. Andreeva). At the same time, it would be beneficial to learn Python as a second programming language in advanced computer science classes (for example, after Pascal or C).

My answer has clearly outgrown the format of the letter, so I’ll publish it here for now, and then, perhaps, develop it into an article.

Of course, attitudes towards Python vary. Indeed, there are concerns that dynamic typing and too much “high-level” language are harmful for learning, that the concept of “array” cannot be replaced with high-level lists, since schoolchildren, “deceived” by the ease of operations with lists, will not understand the principles internal organization etc.

But in my opinion, such criticism comes mainly from “theorists” who have never tried to teach programming in Python, and although Polyakov began publishing articles about Python in Computer Science, it seems he never used it for teaching . But I don’t know any practitioners who criticize Python, that is, people who would try to teach children Python for at least a year and then give up.

For example, E.V. Andreeva, allegedly quoted by Polyakov, three years ago decided to try teaching 6-7 grade schoolchildren in Intellectual in Python. Before this I was quite skeptical about this idea, but decided to try it. Six months later, she was already speaking at conferences and saying that it was best to teach middle school students in Python, that she didn’t really believe in it, but she tried it and in a few months her views changed. So I don’t know what exactly Polyakov quoted and how old this quote is, but yesterday I specifically showed this correspondence to Andreeva and asked her to answer, to which she wrote “Shumilina’s answer - middle school students should definitely be taught in Python.”

What are the advantages of Python? Not only in the simplicity of the language, but also in the fact that it is a huge, multifaceted, versatile world of programming. It’s easy to start programming in this world, and it seems there is no point in discussing the merits of Python as the first programming language - nothing simpler clearly exists (among general-purpose programming languages). It is much more concise than Pascal and programming on it does not require fiddling with a lot of technical things, which is difficult for complete beginners. It is much easier for beginners to write programs if they consist of five lines rather than fifteen, they implement the same algorithms, but less time is spent on writing and debugging the code, which means more problems can be solved, and progress further, and to work with an array, it’s much more convenient to write:

a = * 1000
how
var a: array of integer;
...
for i:= 1 to 1000 do
a[i] := 0;

The result for the programmer is the same, an array filled with zeros is obtained, but in Python it is one line instead of three, and the meaning does not change. And here skeptics, of course, will say that you can’t write like in Python, that a schoolchild should understand that an array is a continuous fragment of memory, that we must declare it, that is, reserve a place for it, that we must initialize, filling it with zeros... Well, our answer to the skeptics is that the meaning for a novice programmer does not change, on the contrary, the line a = * 1000 better reflects what the student wants to get right away (I want a list of one number 0, repeated 1000 times), is much easier to write and allows you to solve more problems!

Just look at the two snippets above, which one is clearer? Which one do you like better?

So, for beginners, Python is undoubtedly better. Moreover, weak children can stop here after getting a general idea of ​​programming. But strong students can move on, and they will have at their disposal a modern universal programming language that is actually used for software development in the world's leading companies. Here, for example, statistics - “What they write on Yandex”: http://blog.yandex.ru/post/ 77617/. You can write websites in Python computer games, GUI, client-server applications, that is, anything.

Now regarding the saying that there are a lot of high-level things in the language, and it is tempting to use them instead of learning how it works. Well, this is a methodological problem, not a programming language problem. The general methodological approach here is this: first we understand how it works, then we are allowed to use the corresponding element of the language. For example, first we wrote the exchange of values ​​of two variables through an auxiliary variable, then I show how this is done using tuples (a, b) = (b, a). First, write the maximum of two or three numbers, then you can use the max function. Then we wrote a program to find the maximum in
sequence (array), then you can use the max function on the list. First, they wrote sorts themselves, then you can use the sort function, and I even insist that schoolchildren use the standard sort function - it’s faster and more convenient, and allows you to solve more problems, but only after they have learned to write sort themselves.

In fact, built-in sorting is available in any modern language programming (Java, C++, PHP), because this is now accepted. Only classic Pascal doesn’t have it (but modern Delphi does), it doesn’t exist in old BASIC (and Visual Basic does), but that doesn’t mean that all these languages ​​can’t be used, because they have built-in sorting? And no one would think of banning the study of these languages ​​in school just because “what if the teacher teaches children to use built-in sorting, and then you can’t explain to these children why they need to study the complexities of sorting algorithms.” Therefore, the problem is not whether the programming language has sort or not, but the problem is HOW to use it. For some schoolchildren, it is enough to explain what “selection sort” is - it is understandable and very easy to write in Python, but with someone you can discuss effective sorting algorithms, and the presence of built-in sorting does not interfere with this. Moreover, if I teach children programming in C++, then I try to teach children how to use sort from STL, and use it effectively, and this does not interfere with the study of sorting algorithms. At MIT (Massachusetts Institute of Technology), all initial programming courses were transferred to Python several years ago. At the new Faculty of Computer Science of the State University Higher School of Economics, created in 2014 with the participation of the Yandex company, Python is the first programming language that students study. Here I cite the new faculty as an example, because... in universities with already established programs it is more difficult to change anything, for example, at the Faculty of Computational Mathematics and Computer Science of Moscow State University, an attempt to replace Pascal with C as the first programming language was unsuccessful due to the reluctance to change established programs and the contingent of teachers.

Next, let's look at the statement "And this can lead to the appearance galaxy of “Python-only programmers” who are not ready to overcome additional restrictions in order to increase the efficiency of the program." In a sense, there is nothing wrong with this. Programming is becoming more and more of a mass profession, and many programmer skills do not apply to what is a higher education, that is, most programmers do not you need to study volumes devoted to sorting algorithms. The complexities of sorting algorithms are, undoubtedly, the sphere of higher professional education, but programmers who know how to write a website in PHP or an accounting program
1C also needs them, and you need a lot of them. In general, such programmers do not need to understand sorting algorithms; they just need to be able to use the standard sort function for any task and know that it can sort arrays better than if they wrote it themselves (and it’s completely strange to require a web programmer to know quick sort algorithms, of course, there will be nothing wrong with this knowledge, but for it to work it is completely unnecessary). So the programmer training system should include both secondary vocational education (which teaches applied things and technologies), and a higher education system (where it is appropriate to discuss the complexity of sorting algorithms), just as it is in many industries, for example, in medicine (a physician with a secondary specialized education performs standard medical procedures, and a physician with a higher education knows how to prescribe treatment, that is, analyze the causes and make a decision). Yes, there are specialties related to programming in both secondary specialized education and higher education, but the system here is not structured as well as in the same system of medical education. And, to be honest, I have little idea what is happening in secondary vocational education with programming training.

One of the analogies I like to use here is the progress in the distribution of automobiles. At the beginning and middle of the 20th century, a car driver had to know the structure of the car and carry out quite complex repairs himself. Any driver must be pretty much a mechanic. Now many drivers, well, if they have something in common
understanding of the structure of a car, they certainly never repair it, preferring to carry out all maintenance at a car service center. Is it good or bad? This, in my opinion, is inevitable. The prevalence of cars has become such that it is difficult to require repair skills and deep knowledge of the car’s structure from all car enthusiasts. The widespread use of the car will inevitably lead to the fact that most drivers will not have deep knowledge of the structure of the car. And cars, in turn, become more convenient and reliable, so they can be used without special skills.

It’s the same with programming - programming is becoming more widespread, and the programming languages ​​themselves are becoming more convenient and simpler. Undoubtedly, the number of programmers is growing and will continue to grow (although there is still a huge shortage of qualified programmers in the industry), while the level of deep understanding of things will decrease. This is inevitable, but this is not a reason to abandon modern high-level programming languages, just as it would not occur to anyone to abandon modern cars just because they are more reliable and convenient, and do not require special knowledge for constant use.

LESSON PLAN #1

Date _____________

Speciality information systems (by industry ) group IS-21

Item Basics of algorithmization and programming

Lesson topic Introduction. Types of classification and purpose of programming languages.

Lesson objectives:

EDUCATIONAL:give short review questions studied in the section “Programming in Pascal”, create positive motivation for studying this section, formulate students’ understanding of the programming language, the components of a programming language, the classification of programming languages, the programming system, its components and their purpose;

DEVELOPMENTAL:skills: translate visual information into verbal, analyze information, build cause-and-effect relationships; develop note-taking skillsEDUCATIONAL: cultivate interest in the subject.

Lesson type Theoretical lesson

Teaching methods Verbal using ICT

Material and technical equipment of the lesson: lecture, PC, electronic textbook.

During the classes

    Organizational moment -2 min

    Setting a lesson goal for students 1 min

    Testing knowledge and skills -20 min

    Presentation of new material -31 min

    Reinforcement of learned material -20 min

    Homework -3 min

    Summing up the lesson - 3 min

Questions for presenting new material:

Introduction

  1. Classification of programming languages

  2. Generations of Languages

  3. Machine-independent languages

    Universal languages.

Reinforcing the material being studied

  1. Name the universal languages.

Lesson summary

Assessing the work of the group and individual students. Reasoning for the grades given, comments on the lesson.

Homework.. Types of classification and purpose of programming languages

functional - according to purpose, functions performed (descriptive, logical, mathematical);

level of language - that is, the level of generalization in operator words of the language (low, medium, high...);

areas of application - that is, where the language is used (system, network, embedded, etc.)

All types of classifications naturally intersect and harmonize with each other, which we will see when considering these classifications, which, if understood, will make it easy to understand any new language - its purpose, capabilities, and acquisition techniques.

Basic hierarchy of programming languages

The basic hierarchy of programming languages ​​is a system-parallel hierarchy, that is, a package of closely related hierarchies: programming stages, generations of programming languages ​​and the languages ​​themselves - protocols for converting structural and algorithmic information: a structural-descriptive description of data and an algorithm for processing it. Therefore, all languages ​​are divided into two polar types: descriptive (declarative) and algorithmic (command). However, since in any algorithm there is a need to describe data and structures, and in any construction there is a need to describe the order of its assembly, real languages ​​are partly declarative and partly algorithmic, which is reflected in the presence of descriptive and command (recipe) parts of any computer program.

It is advisable to start considering a package of parallel hierarchies of programming languages ​​with the hierarchy of programming stages.

Stage 1. Statement of the programming problem- includes the formalization of the programming goal, often quantitative and mathematical, but always formal and logical, allowing to carry out all subsequent stages and achieve the set programming goal after completing its stages.

Stage 2. Algorithmization- includes the construction of a block diagram of the algorithm, that is, sequential steps of data processing and the structure of the data itself for the operation of the program.

Stage 3. “Coding”- (from the American traditional slang “coding”) - writing program text in a basic text programming language that can be understood by a translator - a program that converts text into binary code.

Stage 4. Broadcast- translation of a program into binary “object” code, performed by a translator without human intervention, not counting the debugging process.

Stage 5. Assembling the executable program module- represents the automatic joining of all object modules necessary to obtain a working program - a sequence of commands from the computer processor on which the intended algorithm is executed in the form of a binary code understandable to the processor.

The first stage of programming is the most general, highest hierarchical level of the programming process, and the fifth - performed automatically by a computer - is the lowest. The listed programming stages correspond exactly to generations of languages ​​(GL) - the hierarchy of computer languages, only in reverse order.

Generations of languages (Generations of Languages)

Generation 1GL. Machine languages, low level languages- binary languages ​​of processors, which are a set (alphabet) of commands written in binary code (0,1), which a given processor can execute directly if these commands are entered into its memory as a sequence or immediately submitted to the arithmetic-logical device of the processor. Examples: IBM-PC processor language, ARM processor language.

Generation 2GL. Assemblers, autocodes, system languages, middle-level languages- text languages, understandable to humans and unambiguously translatable (translated) into low-level languages, that is, machine binary code. Programming in 2GL is an order of magnitude more productive than in 1GL, as it is more convenient for human perception. Examples: Macrossembler, C, PL/1.

Generation 3GL. High level languages- text languages, close in vocabulary and syntax to the human language (usually exaggerated English, Pindos), which allow you to write program structures in a form convenient for human thinking and similar to ordinary text - notes, transcripts. Programming in 3GL is an order of magnitude more productive than in 2GL, since it is more convenient for human perception and is an order of magnitude shorter than assembly languages. Examples: BASIC, FORTRAN, PHP and almost all network languages.

Generation 4GL. Visual programming languages- flowchart languages ​​that allow you to display algorithms in software projects, making it easier to create and analyze algorithms. Programming on 4GL is an order of magnitude more productive than on 3GL. Examples: RAD systems, CAD packages, OLAP systems.

Generation 5GL. Intelligent programming languages- allow you to transfer the function of creating algorithms to a computer, leaving only the formulation of the problem to a person. Programming on 5GL is an order of magnitude more productive than on 4GL. Examples: MatCAD system, expert systems.

In system programming, 2GL languages ​​give the best results, because speed of execution and code compactness are important in this area. For text processing and network tasks, 3GL languages ​​are optimal.

Directly related to the hierarchy of generations of languages ​​is the so-called “Standard OSI model", describing 7 levels of hierarchy of protocols (languages) for network information exchange, discussed below.

Functional classification of programming languages

Existing languages Programming is classified into four main functional groups: procedural, object-oriented, functional and logical. Let's give brief definitions each approach.

Procedural programming- programming when the program is separated from the data and consists of a sequence of commands that process the data. Data is typically stored in the form of variables. The entire calculation process comes down to changing their contents.

Declarative programming languages are languages ​​for declarations and construction of structures. These include functional and logical programming languages. In these languages, algorithmic actions are not performed explicitly, that is, the algorithm is not specified by the programmer, but is constructed by the program itself. In declarative languages, some structure or system is specified and constructed, that is, some properties of the created object are declared (declared). These languages ​​are widely used in computer-aided design (CAD) systems, in so-called CAD packages, in modeling, and artificial intelligence systems.

Object-oriented programming- in these languages, variables and functions are grouped into so-called classes(templates). Thanks to this, a higher level of program structuring is achieved. Objects derived from classes call methods(functions or procedures) each other and thus change the state properties(variables). From the formal mathematical side, the object-oriented way of writing programs is based on the procedural programming model, but from the content side it is based not on a function, but on an object, as an integral system that has a standard automatic inter-object interface.

Network languages- languages ​​designed to organize interaction remote computers in an intensive interactive mode, and therefore they are built on the principles of interpretation, that is, line-by-line, interactive processing of strings program code, describing some scenario (script) of network interaction between computers, so they are often called scripting languages, although scripting languages ​​are not necessarily network languages, for example, batch command languages ​​of various operating environments.

Machine-oriented languages

Machine-oriented languages- these are languages, the sets of operators and visual means of which significantly depend on the characteristics of the computer (internal language, memory structure, etc.). Machine-oriented languages ​​allow you to use all the capabilities and features of machine-dependent languages:

    high quality created programs(compactness and speed of execution);

    the ability to use specific hardware resources;

    predictability of object code and memory orders;

    To create effective programs, you need to know the command system and the operating features of a given computer;

    the complexity of the programming process (especially for machine languages and YASK), poorly protected from errors;

    low programming speed;

    the impossibility of directly using programs compiled in these languages ​​on other types of computers.

Machine-oriented languages ​​are divided into classes according to the degree of automatic programming.

Machine language. As mentioned in the introduction, an individual computer has its own specificMachine language(FurtherMY), it is instructed to perform specified operations on the operands they define, soMYis a command one. However, some families of computers (for example, ES computers, etc.) have a singleMYfor computers of different power. The command of any of them reports information about the location of the operands and the type of operation being performed.

In new computer models, there is a tendency to improve internal languages ​​by machine-hardware means to implement more complex commands that are closer in their functional actions to the operators of algorithmic programming languages.

Let's continue the story about command languages, Symbolic Coding Languages(Further I SK), as well as MY, are command. However, operation codes and addresses in machine instructions, which are a sequence of binary (in internal code) or octal (often used when writing programs) digits, in I SK replaced by symbols (identifiers), the writing form of which helps the programmer more easily remember the semantic content of the operation. This ensures a significant reduction in the number of errors when compiling programs.

Autocodes. There are also languages ​​that include all the featuresI SK, through extended introductionmacros - they're calledAutocodes.

Macro instructions are translated into machine instructions in two ways - arrangement And generating. The staging system contains "skeletons" - a series of commands that implement the required function, indicated by a macro command. Macro instructions provide the transfer of actual parameters, which, during the translation process, are inserted into the “skeleton” of the program, turning it into a real machine program.

Macro A language that is a means for replacing a sequence of characters describing the execution of required computer actions with a more compressed form is calledMacro(means of replacement).

Mostly, Macro is intended to shorten the recording of the original program. The software component that enables macros to function is called macroprocessor. The macroprocessor receives the macro-defining and source text. The reaction of the macroprocessor to the call is the output text. Macro can work equally with both programs and data.

Machine-independent languagesMachine-independent languages ​​are a means of describing algorithms for solving problems and information to be processed. They are convenient to use for a wide range of users and do not require them to know the specifics of organizing the functioning of computers and aircraft.

Problem-oriented languagesWith expanding areas of application computer technology there was a need to formalize the presentation of the formulation and solution of new classes of problems. These problem-oriented languages ​​should provide the programmer with the tools to briefly and clearly formulate the problem and obtain results in the required form. There are a lot of problematic languages, for example:

Fortran, Algol- languages ​​created for solving mathematical problems;

Simula, Slang- for modeling;

Lisp, Snoball- for working with list structures.

Universal languages.Universal languageswere created for a wide range of tasks: commercial, scientific, modeling, etc. The first universal language was developed , which became in the sequence of languagesPl/1. The second most powerful universal language is calledALGOL-68. It allows you to work with characters, digits, fixed-point and floating-point numbers.Pl/1has a developed system of operators for managing formats, for working with fields of variable length, with data organized in complex structures, and for efficient use of communication channels. The language takes into account the interrupt capabilities included in many machines and has appropriate operators. The possibility of parallel execution of program sections is provided. The language uses many propertiesFortran, Algola, Cobol. However, it allows not only dynamic, but also managed and statistical memory allocation.

Conversational languagesThe emergence of new technical capabilities posed a task for system programmers - to create software tools that ensure operational interaction between a person and a computer; they were calledconversational languages.

This work was carried out in two directions. Special control languages ​​were created to provide operational impact on the completion of tasks, which were compiled in any previously undeveloped (non-dialog) languages. Languages ​​were also developed that, in addition to management purposes, would provide a description of algorithms for solving problems.

One example of conversational languages ​​is BASIC. BASIC uses notation similar to ordinary mathematical expressions. Many operators are simplified versions of language operators Fortran. Therefore, this language allows you to solve a fairly wide range of problems.

Non-procedural languages constitute a group of languages ​​that describe the organization of data processed using fixed algorithms (tabular languages ​​and report generators), and communication languages ​​with operating systems.

Allowing you to clearly describe both the task and the actions necessary to solve it, decision tables make it possible to clearly determine what conditions must be met before moving on to any action. One decision table, describing a certain situation, contains all possible block diagrams of implementations of solution algorithms. Tabular methods are easily mastered by specialists of any profession. Programs written in tabular language conveniently describe complex situations that arise during system analysis.

Consolidation issues

  1. What are the classifications of programming language?

  2. Name the basic hierarchy of programming languages

  3. What Generations of Languages ​​are there?

  4. What functional classifications of programming languages ​​are there?

  5. Name machine-oriented languages

  6. Name the machine-independent languages

    Name the universal languages.



tell friends