The blog of Joshua Welsh

Book Recommendations for December

Dec. 13, 2020

As the semester grinds to an end for most students we must once again answer the eternal question: what do you do with all this free time?

Usually, I spend the Christmas season with friends and family, enjoying the warmth of the sun and the cool breeze from the trade winds that blow across the island of Trinidad and Tobago. Parang, puncheon, parties, and limes, Trinidad remains a wonderful place to enjoy the holiday season, however, due to the colossal failures of the United States government, the option to fly to Trinidad is currently unavailable. I know I am not alone in my disappointment about my Christmas 2020 plans; most of you reading this will also be experiencing sub-ideal holiday conditions, namely the inability to visit friends or loved ones. Stay strong and though it seems like the battle is lost continue in your patriotic fight to stop the spread.

To help you in this battle and also to solve the eternal question, I compiled a list of interesting books which I will read and I encourage you to read over the month of December. Many of these books are SyFy so hopefully my fellow computer science majors may enjoy them. They are in no particular order and I found them from a variety of sources.

- The Alchemist by Paul Coelho
- Infinite Jest by David Foster Wallace
- Invisible Cities by Italo Calvino
- Program or Be Programmed: Ten Commands for a Digital Age by Leland Purvis
- The Metamorphosis of Prime Intellect by Roger Williams

I hope you all enjoy and have a safe Winter break. Hopefully, if I can switch off my phone for long enough to read all these books, I will write a review in January.

The History of C++

Dec. 12, 2020

I wrote this post for section.io but it was rejected for bureaucratic reasons. I decided to post it here as my first post.

Over the decades, many programming languages have grown in popularity only to fade into obscurity, but few have withstood the test of time like C++. C with Classes, later renamed to C++, ranked top five for most used programming languages in the year 2020 while being 35 years old- a massive achievement for any technology. C++, pronounced C Plus Plus, is a statically typed, general-purpose programming language that supports several coding paradigms such as object-oriented, functional, and generics. Additionally, the language provides powerful low-level memory management which, when combined with its versatility in approaches, makes for one of the most used and beloved programming languages in the history of software design. C++ finds its way in almost every domain and field: game design, operating systems, compilers, machine learning and artificial intelligence, enterprise-level software (Adobe Suite and Microsoft Suite are two main examples), and robotics. As you read this article, a robot is walking across Mars operating on C++ source code. You might ask yourself, how did “the Swiss Army Knife of programming languages” come into being? Well, it all starts in the late 1970s with a curious Ph.D. student, Bjarne Stroustrup, and the “Godfather of the Class” Simula.

Bjarne Stroustrup and Simula

“Any language that uses the world-class is descendant either directly or indirectly from Simula” - Bjarne Stroustrup. In 1979, Bjarne, while working on his Ph.D. thesis, used a new programming language called Simula. Simula was the first programming language that supported the concept of allowing users to create user-defined data types. Though still primitive, this idea would revolutionize the world of software engineering.

Imagine you had to design a city simulation. Before Simula, simulating vehicles and traffic required writing code for each vehicle individually even if they shared features such as an average speed and an average size. Simula first introduced the idea that we could create our own data type, Vehicle, and create subsets of those data types (sub-classes) which inherit from Vehicle class (super-class). For example, a car and a bike could both inherit features from the Vehicle class. The ability to abstract away complexity would fundamentally change the field and Bjarne knew it. However, Simula had many limitations, mainly speed. The slow language which lacked portability sparked a revolution which it would not lead. Taking the best aspects of Simula, Bjarne decided to build upon the beloved programming language C. C’s popularity came from its portability and speed while not sacrificing true low-level functionality. Bjarne began working on “C with Classes” a subset of the C language. He added several features to the already powerful language of C, namely classes, basic inheritance, inlining, default function arguments, and strong type checking. Bjarne worked tirelessly on the language and the first compiler for the language. The first C++ compiler, Cfront, was written in C++. When both were first released in 1985, the community was in awe of the achievement. The self-hosting compiler, the first of its kind, ran extremely well and many posit that the compiler was a major contributor to the early success of the language.

Let's Make it Standard

From 1985 to 1998, C++ exploded in popularity but a glaring problem was beginning to rear its head. C++ was still not standardized. Without a standard version of the language, every company or individual could in theory create, modify, and distribute their own version of C++. The problem of ownership arises without a standardized language, and ownership is a massive problem for multi-billion dollar companies. Industry leaders approached Bjarne in 1998 asking him to help them standardize the language for the good of the community, and later that year C++98 became the first C++ ISO (International Organization for Standardization) Standard released. The next release, C++03, was a minor update with mainly bug fixes. The next major update to C++ came 8 years later. The drought of new updates affected the popularity of the language causing many to argue that the language was dying and would quickly be replaced by Java and C#, languages with better web support and easier syntax. C++11, however, stopped the bleeding. The new version of C++ expanded the core functionality adding features such as range-based for loops, lambda functions, and more syntactic sugar.

All Hail the King:

With the added features of C++11, the language began growing in popularity once more and dominating the software engineering ecosystem. After the 8-year gap between C++03 and C++11, the standardization committee decided that long windows between releases could not continue. The committee going forward decided on 3-4 year releases, no more no less. With a schedule in place, the releases of C++14, C++17, and C++20 preceded without any difficulties. Each release adds more functionality and changes in syntax: from generics to coroutines for parallel programming.

C++ remains one of the most popular programming languages for the last 35 years because of its simplicity. Bjarne did not start out looking to create solely a language with classes but rather a stable, well-designed language, which provided users the ability to abstract away complexity in a variety of ways while never sacrificing speed. Stroustrup often remarks that a C program translated to C++ source code and it runs faster and it is true. C++ inspired a reimagining of programming languages which lead to several of the major languages we know today such as Java, C#, Rust, and Golang.

Archive: