Tanks on Pascal: how children were taught programming in the 90s and what was wrong with it.

A bit about what school 'informatics' was like in the 90s, and why all programmers back then were self-taught.

Tanks on Pascal: how children were taught programming in the 90s and what was wrong with it.

What they taught kids to program with

In the early 90s, Moscow schools began selectively equipping classrooms with computers. They immediately installed grates on the windows and heavy iron-clad doors. Somewhere, a computer science teacher would appear (looking like the most important person after the principal), whose main task was to ensure that no one touched anything. Absolutely nothing. Not even the entrance door.
In classrooms, you could most often find systems BK-0010 (in its varieties) and BK-0011M.

Tanks on Pascal: how children were taught programming in the 90s and what was wrong with it.
Photo source from here

They told children about the general structure and a dozen commands of 'Basic,' so they could draw lines and circles on the screen. For younger and middle school grades, this was probably sufficient.

Back then, saving their creations (programs) posed separate problems. Most often, computers were connected into a network with a 'shared bus' topology and a transmission speed of 57600 baud using single-channel controllers. There was usually one floppy drive, and it frequently had issues. Sometimes it worked, sometimes it didn't, sometimes the network hung up, and sometimes the diskette couldn't be read.

I used to carry this creation with a capacity of 360 KB.

Tanks on Pascal: how children were taught programming in the 90s and what was wrong with it.

The chances of retrieving my program from it again were about 50-70%.

However, the main problem with all these 'BK' computer stories was endless freezes.

This could happen at any moment, whether during code entry or program execution. A frozen system meant that you had wasted 45 minutes, as you had to start everything over, but there was no time left in the lesson for that.

By 1993, normal classrooms with 286 machines started appearing in some schools and lyceums, and in some places, even 'threes' were available. In terms of programming languages, there were two options: where 'Basic' ended, 'Turbo Pascal' began.

Programming in 'Turbo Pascal' using 'tanks' as an example.

In Pascal, children were taught to build loops, draw various functions, and work with arrays. In the physics and math lyceum, where I spent some time, only one class per week was allocated to informatics. For two years, it was quite dull. Naturally, I wanted to do something more serious than just outputting array values or some sine wave to the screen.

Tanks

Battle City was one of the most popular games on NES clone consoles (Dendy, etc.).

Tanks on Pascal: how children were taught programming in the 90s and what was wrong with it.

By 1996, the popularity of 8-bit consoles had faded; they had long been gathering dust in closets, and I thought it would be cool to create a clone of Tanks for PC as something on a larger scale. Following is how I had to get creative to implement graphics, mouse input, and sound in Pascal.

Tanks on Pascal: how children were taught programming in the 90s and what was wrong with it.

You can only draw sticks and circles

Let's start with graphics.

Tanks on Pascal: how children were taught programming in the 90s and what was wrong with it.

In its basic version, Pascal allowed for drawing some shapes, filling them, and defining point colors. The most advanced procedures in the Graph module that brought us closer to sprites were GetImage and PutImage. With these, you could capture a portion of the screen into a pre-allocated memory area and then use that piece as a raster image. In other words, if you wanted to repeatedly use some elements or images on the screen, you first drew them, copied them to memory, erased the screen, drew the next one, and continued until you created the desired library in memory. Since all of this happens quickly, the user does not notice these tricks.

The first module that used sprites was the map editor.

Tanks on Pascal: how children were taught programming in the 90s and what was wrong with it.

It featured a marked game field. Clicking the mouse would bring up a menu where you could choose one of four obstacle options. Speaking of the mouse...

The mouse – it's already the late '90s.

Everyone had mice, but until the mid-'90s, they were only used in Windows 3.11, graphics suites, and a small number of games. In Wolf and Doom, we played only with the keyboard. In the DOS environment, a mouse was not particularly necessary. As a result, Borland did not even include the mouse operation module in the standard package. You had to look for it among acquaintances, who would throw up their hands and exclaim, 'Why would you need that?'

However, finding a module to poll the mouse is just half the battle. To click on the screen buttons with the mouse, they needed to be drawn. In fact, in two versions (pressed and unpressed). For the unpressed button, the top is light, while below it is a shadow. Conversely, for the pressed one. And then redraw it on the screen three times (unpressed, pressed, then unpressed again). Plus, don't forget to set the display delays, and hide the cursor.

Tanks on Pascal: how children were taught programming in the 90s and what was wrong with it.

For example, the main menu processing in the code looked like this:

Tanks on Pascal: how children were taught programming in the 90s and what was wrong with it.

Sound – just a PC Speaker beep.

Sound is a whole different story. In the early nineties, clones of the Sound Blaster were just beginning their victorious march, and most applications only worked with the built-in speaker. Its maximum capability is simultaneous playback of only one tone. And this is what Turbo Pascal allowed. Through the sound procedure, it was possible to "beep" at different frequencies, which is enough for sound effects of gunfire and explosions, but it was not suitable for a musical intro, which was popular at the time. Ultimately, a rather clever solution was found: in the software archive, there was a small executable downloaded from some BBS long ago. It could work wonders – playing uncompressed wav files through the PC Speaker, and it did this from the command line without an interface. All that was needed was to call it through the Pascal exec procedure and ensure that this construct didn't crash.

As a result, powerful music appeared in the intro, but a funny thing happened with it. In 1996, I had a system with a Pentium 75 overclocked to 90. Everything worked perfectly on it. However, at the university, where we were put into Pascal in the second semester, the classroom was filled with outdated "386s." By agreement with the instructor, I brought these tanks to the second class to get credit and not return. And so, after the launch, a loud roar mixed with gurgling throat sounds came from the speaker. In general, the 33 megahertz "386" DX couldn't handle that little executable properly. But everything else was fine. Of course, excluding the sluggish keyboard polling, which spoiled the entire gameplay regardless of the PC's performance.

Play video

But the main problem is not in "Pascal".

In my opinion, 'Tanchiki' was the maximum that could be squeezed out of Turbo Pascal without assembly inserts. The obvious disadvantages of the final product were the slow keyboard polling and slow graphics rendering. The situation was worsened by the extremely limited number of third-party libraries and modules, which could be counted on one hand.

But what disappointed me the most was the approach in school education. Back then, no one explained to children the advantages and possibilities of other languages. Lessons practically immediately started talking about begin, println, and if, which locked students within the Basic-Pascal paradigm. Both languages can be considered purely educational, with their 'combat' application being a rare occurrence.

Why teach children fake languages is a mystery to me. Sure, they are more visual. Yes, variations of Basic are used here and there. But in any case, if someone decides to tie their future to programming, they will have to learn other languages from scratch. So why not set the same educational tasks for children, but already on a proper platform (language), within which they could further develop independently?

Speaking of tasks, in school and university, they were always abstract: calculate this, build a function, draw something. I studied at three different schools, plus we had 'Pascal' in the first year of university, and not once did the teachers set any reasonably practical tasks. For example, creating an address book or something useful. Everything was contrived. When a person spends months solving empty tasks that then go in the trash… In general, graduates often leave university burnt out.

By the way, in the third year of that same university, they introduced 'C++' into the program. It seemed like a good initiative, but people were tired, fed up with fakes and 'educational' tasks. No one had the enthusiasm it had during the first introduction.

P.S. I googled what languages are currently taught in schools during informatics lessons. It's the same as 25 years ago: Basic, Pascal, with few instances of Python.

Source: habr.com

Buy reliable website hosting with DDoS protection, VPS VDS servers 🔥 Buy reliable website hosting with DDoS protection, VPS VDS servers | ProHoster