How a school teacher invented one of the most influential programming languages

In short, C works everywhere. This language is not just a large dinosaur that somehow managed to survive to this day. He is extremely practical, and therefore incredibly successful. Surprisingly, the origins of C are far from being successful. It was the result of decades of failure, and if it were not for the efforts of a school teacher who loves programming during the holidays, the language might not have appeared. This is a story about incredibly slow computers, the three David’s and the long legacy of the C language. C ++ programming we share the translation of the article with a short biography of Christopher Stratchy.

About the prevalence of C from the Unix kernel to CPython

Unix is ​​written in C. Originally written in assembly, the Unix kernel was rewritten in C yet in 1973… This made Unix much more portable across machines and contributed to its popularity. Without Unix, we wouldn’t have all the beautiful modern operating systems – remember Linux, Mac OS X, Android, iOS, Chrome OS and in general everything on which your router works.

If you have dealt with databases, then you have probably also worked with C, even if you did not know about it. Database management systems – Oracle Database, MySQL and others written in C. Most of them have since been rewritten in C ++, but it is a direct descendant of C.

And even if you only know Python, you’ve probably been working with C all this time; only if you did not choose Jython, IronPython or PyPy, then you wrote on the implementation of the language CPython… You write your code in Python, but the interpreter that converts your code into machine-readable code is actually written in C.

A school teacher who was friends with Alan Turing

Meet Christopher Stratchy. Born in 1916 into an influential British family, he studied at the University of Cambridge and met many famous scientists there. For many years he seems to neglected studies, and his results in the final exams were very deplorable. Perhaps that is why he did not pursue an academic career, like many of his peers, but during the war he did research industrial radar, then became a school teacher and remained so until 1951. It was then that everything changed.

A friend introduced him to the equipment of the British National Physical Laboratory. Stratchy began to spend his school holidays and forced delays in the lab with the Pilot ACE, Alan Turing’s first computer with an automatic computing engine. Stratchy aimed to teach the computer to play checkers. To solve this problem at a time when computers were mainly used for solving equations quickly was amazing.

First attempt failed: y Pilot ACE there was not enough memory. You may find this funny, but remember – it was the 1950s! Together with his old friend Turing Stratchy, they managed to develop a more perfect machine – the Ferranti Mark I. Under the leadership of Turing, Stratchy finally taught the computer to play checkers. Rumors of an unusual achievement spread quickly, and Stratchy was soon called in to push computer science developments for the British government.

Three David’s wanted to create a new language

Meanwhile, Cambridge wanted to buy a new computer: at the time it was a big deal, and since the computer was completely new, it was clear that it needed a new operating system, but not necessarily a new language, but the three David’s – Hartley, Barron and Wheeler – thought about inventing it, and at the same time have fun… We add that these three did not ask future users about the pros and cons of the old languages. For example, Fortran IV was already in use at that time and quite fit for work. However, the three David decided they could easily create something better. The University of Cambridge was skeptical about the new language, but three David’s won.

They named the language CPL (Cambridge Programming Language), and after a couple of researchers from the University of London joined the three David’s, it became known as the Combined Programming Language. Looking back Hartley notesthat trying to create a new language was “fucking stupid.”

The new language turned out to be too complicated

It might also have been “damn stupid” to involve Christopher Stratchy on the project. There was no doubt about his computational abilities, but he seemed so in love with the project that he could not prioritize. Instead of effectively solving big problems, the developers became fixated on small ones – and soon the CPL became known as Christopher’s Programming Language.

All of these small details introduced at Stratchy’s insistence made the language too complex. When the developers wanted to write a compiler, they failed to do so: the resulting machine code turned out to be ineffective.

Later, the language became too simple

When Stratchy left for MIT for a few months, Martin Richards joined Ockmand and decided to simplify the language. Of course, the goal was to get a language that would allow you to write a good compiler and get efficient machine code. Richards removed everything that was not important from the CPL, turning the CPL into BCPL – Basic CPL, which in a sense was not only a new language, but also a recognition of the failure of the CPL.

When Richards joined Stratchy a little later at MIT, a colleague from Bell Labs came to see what the two of them were doing. This man’s name was Ken Thompson. He was working on Multics, another operating system that was about to be abandoned. System survived, But that is another story.

As a result, Thompson switched to developing Unix – one of the most popular operating systems to this day. He managed to install Unix on a small PDP-7 computer, but BCPL was cumbersome for that machine. Thompson abbreviated the language to the functions he considered most important and named the new language B.

How was Xi born

In 1971, Dennis Ritchie adapted B and added functionality to the language to make it useful for computers. He named the resulting language NB – New B.

Meanwhile, Thompson was rewriting Unix into a high-level language. At that time, most operating systems were written in assembler, because of this, every time after buying a new machine, they even had to develop a new operating system; but Unix in a high-level language would work on any machine.

Thompson tried to rewrite Unix to NB but failed. Then Richie and Thompson added new features to NB until the idea was successful. It is noteworthy that the developers added structures to the language – then they were not in any language. The innovation was noticeable enough to rename NB, and in 1973 C was born. Soon the C language became popular and still remains so.

C spread like a slow forest fire

Although numerous C inventors were confident, they did not expect their language to conquer such vast expanses. One of the reasons for the success could have been the extreme popularity of the PDP-11. It was not expensive to install Unix on it, and C came with it. Most computers then worked in universities; graduating from university, many students were already familiar with C. This helped the language spread across many industries and, of course, academia. Finally, the book by Brian Kernighan and Dennis Ritchie “C programming language “ was simple and concise, especially for a text about a programming language. This book made it easy for beginners to master the language.

Despite its age, C can be more agile than your grandfather.

Somehow, by unbeaten paths, the C language succeeded. But this language is the result of a too complex CPL, too simple BCPL, an even simpler B, and a slightly more complex but still simple NB. And without Thompson’s task to rewrite Unix, C would never have appeared.

Christopher Stratchy, a former high school teacher, overcomplicated things and thus started a series of failures. But without them, C might not have existed.

The peculiarities of the C language show up everywhere. Such an important concept as structures, as well as operators like the increment and decrement ++ and – little things can be found in many languages ​​today; without C, all this would not exist, as well as the descendants of the language – C ++, C #, etc.

And all this is only the legacy of an extremely fast and secure language, the qualities of which make it the preferred tool in such complex areas as robotics, computer vision, the Internet of things, etc. This does not mean that languages ​​like Python are not used, especially for the first outline. But the final step – fine polish if you like – is often written in C or C ++.

Yes, judging by its age, C is a dinosaur. But I bet he is faster and more agile than your grandfather! Or your grandson, for that matter …

If you want to program in C ++, feel the history of technology, but be in demand as a specialist, then you can pay attention to our course on C ++ development, the program of which begins with basic theory, introduces modern C ++ standards and is designed for three projects in the portfolio, and if you want to work or are already working in the forefront, you can take a closer look at the flagship Data Science coursewhere you will learn a profession from scratch or upgrade your skills.

find outhow to level up in other specialties or master them from scratch:

Other professions and courses

Similar Posts

Leave a Reply

Your email address will not be published. Required fields are marked *