High level programming in PHP. Part 1. Introduction

    To begin with, let's define what is meant by a "high level"? Traditionally, programming languages ​​are divided into generations. The term generation of the language itself is rarely used in Russian technical literature, and the language itself can not always be clearly and categorically attributed to one generation or another. So let's figure it out, first with it, and then move on to PHP itself.

    A generation of language is indirectly related to its age. The word "generation" expresses only general tendencies and abstract language terms. Even today, languages ​​of the “younger” generations are still being created to solve any specific problems, if there are prerequisites for this.

    The first generation language is machine code. It is still being used, and all other programming languages ​​are ultimately translated into it. Young people may not be aware, but even 30-40 years ago, live people wrote on it. In addition to jokes. Not hackers, but application programmers. Just like byte by byte were application programs, such as payroll for plant employees.

    The most famous representative of the second generation is Assembler (ASM). With it, the speed of writing programs and compatibility when transferring to related equipment increased. The assembler didn’t just bring some mnemonic commands into correspondence with machine codes, but allowed to abstract from many technical details, allowing more focus on solving an applied problem. Actually this last thesis is the main sign of induction in the transition from one generation of language to another.

    The third generation of languages ​​allowed us to almost completely disengage from “iron”. There are already so many that it is difficult to list. Some of the pioneers are Fortran, Pascal, BASIC. Third-generation languages ​​are still the most used and it seems that they cover all the necessary needs of modern programming. However, progress does not stand still. Programming theory took the next step and spawned the fourth generation of languages ​​(4GL).

    Not every language has a label of a specific generation and its clear place on the scale. An example of this is C. Although C appeared when the era of the third generation was already in full swing, he was born with obvious signs of a second generation language. This is not attavism and degradation. This is exactly what he thought of - a language for writing operating systems. Taking all the necessary innovations and syntactic conveniences of third-generation languages, it allows you to write programs that are practically optimized in the same way as in Assembler. We can say that it is at around 2 ½ generation.

    No less interesting is the picture with C ++. Syntactically, this is the same C with extra bells and whistles. But because of them, C ++ has ceased to be a language. By itself, it is of no greater value than C. It becomes interesting then, one or another object hierarchy is created in it, operators are redefined, etc. When we get a new concept for working with data. In practice, this is a new language with C syntax that can correspond to any generation. That is, in fact, C ++ is not a language, but a tool for creating languages. Unfortunately, most programmers do not grab stars from the sky. Whatever the sophisticated hierarchy of objects created in C ++, it will correspond to the banal third generation of languages. OOP is in full perpendicular to the line of increasing abstractions.

    We now live at the junction of the eras of the third and fourth generation. Many simply do not understand the very meaning of the emergence of a new generation, despite the fact that the old languages ​​so perfectly solve all problems. The essence of the next step induction is still the same - an abstraction from technical details in order to more quickly solve an applied problem.

    Here we should give examples of languages ​​of the fourth generation. Before this, a reservation must be made that the languages ​​mentioned below may possess, to one degree or another, the properties of the fourth generation. This may not be explicitly expressed syntactically. 4GL is a new concept, not a new syntax. Syntactically, the language may be similar to the language of the third generation, but the approach to working with it will be different.

    Formally, the fourth generation languages ​​include SQL. This is the most famous representative, but since it is used in a very narrow specific task, it does not clearly demonstrate all aspects of 4GL. One of the earliest attempts was made by Informix. Together with their database and a set of standard libraries for other popular third-generation languages, they offer their own Informix-4GL language. They took SQL as a syntactic model and supplemented with other language constructs to make it a complete development environment in which SQL commands are not something foreign, enclosed in quotation marks, but the native part of the language. In this sense, the fourth generation languages ​​include the dBase, FoxBase, Clipper, and the like families.

    An attentive reader may notice from several of the examples listed that they are not even talking about the language here, but about the development environment. This will be a correct observation, since modern applications require databases, not just as something where you can save some configuration data. The database (in the broad sense of the word) becomes the core around which the application is built. Therefore, it is not surprising that she no longer wants to be content with the rights of a third-party library (poor relative). Due to natural limitations, we get a situation when a database is not tied to a language, but a language is built around a specific implementation of the database. Universal solutions are not yet known to me.

    Recently, in addition to the databases, another pillar has appeared around which it is necessary to build applications, and which has requested its lion's share of attention - the web. But more about that below.

    To be continued ...
    High-level programming in PHP.
    Part 2. The place of PHP on the generation scale.

    Also popular now: