How a 70s teacher invented C, the hugely influential coding language

You might be wrong if you think C is a language that only white 60-year-old men can understand. It is the most popular programming language today. It is still active in more areas than you might think.Unix, for one, is written in C. Unix was originally written in assembly but the Unix kernel has been rewritten in C since 1973. Unix became much more portable and adaptable across multiple machines thanks to this. Without this, there wouldn't be so many operating systems today, such as Linux, Mac OS X and Android, iOS, Chrome OS and any other OS you may have.You've probably used C if you have ever worked with databases. Even if it was not obvious, you have probably used C. Database management systems such as Oracle Database, MySQL and other are written in C. However, C++ is also a descendant of C.Even if you only use Python, it is likely that you have been using C every day. Unless you're using Jython, IronPython, or PyPyy, CPython is what you are using. This is the original Python implementation: you are writing Python code. However, the interpreter that converts your code into something the machine can understand is actually C.C is everywhere. It's more than a dinosaur that somehow survived in the modern age. Because it is so useful, it's an incredible success story.It may be surprising that C did not come from success. It was the result of a decade of failures.Alan Turing's school teacher friendChristopher Stratchey. He was born in 1916 to an influential British family. He studied at Cambridge University, where he met many famous scientists. He seemed to have had a long-standing tendency to neglect his studies and his performance at the final exams was not very impressive.This could be why he did not pursue an academic career as many of his peers. He spent the war years working in radar research. He became a teacher and continued to be one until 1951.He was able to see the difference. He was introduced to the National Physical Laboratory by a friend. Stratchey spent his school holidays and downtime at the Pilot ACE labs, which housed the first computer equipped with Alan Turing's Automatic Computing Engine.Stratchey set out to teach the computer how checkers was played. It was amazing that computers could tackle such a complex task in a time when computers were mostly used to solve complicated equations quickly.Pilot ACE did not have enough storage capacity so he failed his first attempt. While you might laugh at the size of that memory, it is still valid.Stratchey was able to build a better machine through the help of his friend Alan Turing, but he did not succeed in building it. He finally succeeded with the help of his friends.Stratchey was soon called to promote computer science developments for the British government.Cambridge University was skeptical about the possibility of a new language. But, the three Davids prevailed. Image by the authorThree Davids Want a LanguageThe university of Cambridge wanted to purchase a new computer while they were still in Cambridge. This was a huge deal at the time. Because the computer was new, they thought about creating a new language.A new computer would need a different operating system. But not necessarily a different language. David Hartley and David Wheeler, three researchers, were determined to create a new language.The three Davids also didn't ask future users about the pros or cons of using old languages. Fortran IV was, for instance, already in use at the time, and would have been suitable for the job.However, the three Davids believed they could create something even better.CPL was shorthand for Cambridge Programming Language. After a few researchers from London joined the three Davids, the name was changed to Combined Programming Language.David Hartley notes that it was stupid to try to learn this new language in hindsight.The language became too complexIt was perhaps also stupid to invite Christopher Stratchey as the project's manager. Although his computational skills were unquestionable, he seemed so passionate about the project that it was impossible to give him a clear set of priorities. Therefore, the development team became too focused on small issues and not enough to address the larger ones.CPL became known soon enough as Christophers Programming Language.The language was too complex because of all the details that the team added to Stratcheys insistance. The compiler they tried to create was not efficient because of the inefficient machine code.Richards took everything from CPL that was not important. Image by the authorThe language became too simpleMartin Richards joined CPL to help simplify the code after Stratchey had left MIT for a few months. It was the goal to create a compiler that is efficient and machine code that is good.Richards created BCPL from CPL Basic CPL. This was both a new language and an admission that the old CPL had failed badly.A colleague from Bell Labs visited him when he joined Stratchey at MIT a bit later. Ken Thompson was a colleague who had been working on Multics (another operating system that was soon to be abandoned). (It survived, but that's another story.Thompson eventually decided to develop Unix, which is still one of the most popular operating systems. Although he was able to install Unix on his small PDP-7 computer, BCPL was too large to fit on the same machine. He reduced it to the most important features and named the new language B.C is finally bornDennis Ritchie, in 1971, had adopted B and was adding features that would make it more useful for faster computers. He called this language NB New B.Thompson was at the time working to rewrite Unix in high-level languages. Most operating systems at the time were written in assembler. This meant that one would have to create a new operating system every time one purchased a new machine. High-level Unix would, however, work on any machine.Thompson attempted to use NB but was unsuccessful. Ritchie then continued to add features into NB until he could write Unix. They added structures that were not found in other languages at the time.The two of them deemed the structure a significant change and decided to name it a new language. Voil! In 1973, C was born.C quickly became a popular choice and is still a staple. Image by the authorSlow spread of wildfiresAlthough they were many creators of C, they didn't know how the language would conquer so many spaces.The PDP-11 minicomputer was very popular, which could have been a factor in its success. It was very affordable to install Unix on it. C also came with Unix.Many computers were first developed at universities during that period. This helped C spread through many industries and every nook of academia.The book The C Programming Language by Dennis Ritchie and Brian Kernighan was very compact, especially considering it was a book about programming languages. This made it easier for beginners.C may be a little older than your grandpa, despite its age.C somehow succeeded in spite of its incredibly complex and difficult ways. CPL was too complex, BCPL was too simple and BPL was even more complicated. NB was slightly more complicated but still too simple. It might not have happened without Thompson's task of rewriting Unix.Christopher Stratchey was the ex-schoolteacher who made too many complicated things and started the series of failures. Without those, C may not have been invented.There are many features of C. Many languages have C features, including big concepts such as structures and little things like the -- increment and decrement operator. C would not be able to create them without C. C# and C++ wouldn't exist either.C is a legacy language that has been used for centuries. C is also fast and secure, making it an ideal tool in many complex areas such as robotics, IoT and computer vision. However, languages such as Python are still used for initial sketches. The final step, the polishing of the sketch, is often done in C++ or C++.C, if you look at its age, is definitely a dinosaur. However, I'm sure it is more agile and nimble than your grandpa. Your grandchild, or for that matter!This article was written and published by Rhea Motafis on Data Driven Investor. It can be found here.