📜 ⬆️ ⬇️

Pascal, teaspoon number 0

Habrahabr contingent is very diverse. And as the statistics says, is divided into many layers. Here, anyone can find information on their "taste and color." But not everyone here is a great programmer, IT industry experts, or just crazy geeks.
I, as a lyceum student, a student of the 11th grade, would like to contribute to the advancement of the process of learning programming languages.
In the CIS countries, in the school course, most often, Pascal is taught, and its basics. I studied it myself, and I was glad of it. But not all schools (lyceums, technical schools) have the opportunity to give in-depth knowledge and sometimes you have to learn yourself. As for me, school olympiads are good practice. About this and many other things I wanted to tell.

Where to begin?


It seems to me that we should start by studying the environment itself. In schools, you do not often see decent equipment, where you can use "heaped" development environments and, as a rule, use Turbo Pascal 7.1 , TP FOR WINDOWS and many similar environments for Pascal.
We downloaded, unpacked, our turbo.exe, launched. Not running, incompatibility with a 32-bit system? (users of Windows XP, Vista will understand). To make everything work, you should create a * .bat file, and change it with a usual notepad by writing “turbo.exe” inside. (if absolutely laziness - tp.bat. Put in ... \ TURBO PASCAL 7.1 \ BIN).
If everything is okay then we will see this:


What to do next?


In the network there are so many textbooks devoted to the study of this language. It is not difficult to find them in electronic form, but I would advise you to buy at least one book for home use and use it as a dictionary (often it will fly out of your head, open, spy, work further).
I would recommend:
When interest manifested, I advise you to try yourself in competitions.
Here are some interesting resources:What is useful is the opportunity to feel the atmosphere of a real Olympiad, competition, smash brains over the task and its implementation, learn something new.

A bit of history and let's get started


As the name suggests, this is the development environment for the Pascal programming language. The Turbo Pascal compiling component was based on the Blue Label Pascal compiler, originally created in 1981 by Anders Hejlsberg for the NasSys operating system of the Nascom microcomputer. It was later rewritten as Compass Pascal for the CP / M operating system, then as Turbo Pascal for DOS and CP / M. One version of Turbo Pascal has been available under the Apple Macintosh since about 1986, but its development ceased around 1992.
')
When the first version of Turbo Pascal appeared in 1983, this type of development environment was relatively new. During the debut of the American market, Turbo Pascal was priced at $ 49.99. In addition to the attractive price, the built-in Pascal compiler was also of very high quality. The prefix "Turbo" hinted at both the compilation speed and the speed of the executable code produced by it.

For that time, it was a terrific development environment. It was simple and intuitive, with a well-organized menu. Early versions used the WordStar hotkey layout. In later versions, it became possible to quickly get a definition of a keyword in a language by simply placing the cursor on a keyword and pressing the help key. Help articles often included code samples using this keyword. This allowed inexperienced programmers to study Pascal even without the help of books, using only the development environment.

The medium made it easy to embed Pascal in the insert in assembly language. The user had the opportunity to go through the program step by step; when switching to an assembler unit, it also worked. At any time, the user could add a variable or register to a conveniently located window to observe them. With line-by-line debugging of programs using the IBM PC graphics modes, the program correctly switched between the graphics mode of the program and the text mode of the development environment.

Besides all this, there was a profiling tool. Books included in the delivery of Borland Pascal, gave a detailed description of the language of the assembler Intel to specify the number of clock cycles needed to perform each instruction. In general, the system provided excellent opportunities for code optimization; the user was not required to use anything other than the development environment. Everything was done so perfectly that even a schoolboy could use it.

Since the early 1990s, TP / BP has been used in universities to study fundamental programming concepts.

Probably, the development of Microsoft Pascal was discontinued due to competition with high quality and the price of Turbo Pascal. Another version says that Borland has entered into an agreement with Microsoft to stop developing Turbo BASIC (the development environment for BASIC, branched off from Turbo Pascal) if Microsoft stops developing Microsoft Pascal. For a while, Microsoft released QuickPascal, which was almost 100% compatible with Turbo Pascal.

For several years, Borland has improved not only the development environment, but also the language. In version 5.5, advanced object-oriented programming features were introduced. The latest released version was version 7. Borland Pascal 7 included a development environment and compilers for creating programs for DOS, extended DOS and Windows 3.x, while Turbo Pascal 7 could only create regular DOS programs.

Since 1995, Borland has stopped developing Turbo Pascal and proposed as a replacement the Delphi development environment, which includes the programming language Object Pascal.

Without breaking the tradition


And now let's try to write the first program together.
Our program will display to everyone a painfully well-known phrase.

Program Xabr; { - }
Uses CRT; { , . }
Begin { }
ClrScr;{ , RT}
Writeln( 'Hello XabraXabr!' ); { }
end . { }


* This source code was highlighted with Source Code Highlighter .


Press Ctrl + F9 and view the result of our work:



What did we do today?


I believe that anyone who wants to learn how to program should start small, they will not catch at the drops, buckets, and so on, as we saw on Habré, let alone the student. At one time, I regretted that teaching C began only at the end of the 10th grade, and we taught Pascal to the 9-10 grades, but as it turned out, now it is easier for me to understand the syntax of other languages, I quickly grasp, understanding the basics. I believe that I was able to intrigue future "programmers", and they podchernuli something.
Thanks for attention.

UPD. Thanks for the downed karma! After that, you don’t want to write, because you are afraid that a crowd of idiots will come along and will catch it.

Source: https://habr.com/ru/post/55534/


All Articles