Yesterday, I bought myself the ePub eBook of the 4th edition of Bjarne Stroustrup’s The C++ Programming Language. For those who do not know, Bjarne is the originator, the one who gave birth to the C++ programming language ±30 years ago. The 4th edition of the book covers the newest standard of the language, commonly referred to as C++11.
For the past three years I’ve been programming in C#, and so I decided to pick up C++ again (I programmed in it from 1994-2010; 16 years). From the time that I started with C++ back in 1994, a lot has changed in the language, hence, the need to get the new edition of the book with all the changes related to C++11.
I originally had the third edition of the book, which was published way back in 1997. For some reason, I cannot find that edition in my study anywhere. The third edition of Stroustrup’s book eventually also became the foundation of the original C++ standard in 1998 and became known as C++98.
“The result has been a language with greatly improved abstraction mechanisms. The range of abstractions that C++ can express elegantly, flexibly, and at zero costs compared to hand-crafted specialized code has greatly increased. When we say “abstraction” people often just think “classes” or “objects.” C++11 goes far beyond that: The range of user-defined types that can be cleanly and safely expressed has grown with the addition of features such as initializer-lists, uniform initialization, template aliases, rvalue references, defaulted and deleted functions, and variadic templates. Their implementation eased with features, such as auto, inherited constructors, and decltype. These enhancements are sufficient to make C++11 feel like a new language.
For a list of accepted language features, see the feature list.”
He further writes concerning the new C++11 libraries,
“I would have liked to see more standard libraries. However, note that the standard library definition is already about 70% of the normative text of the standard (and that doesn’t count the C standard library, which is included by reference). Even though some of us would have liked to see many more standard libraries, nobody could claim that the Library working group has been lazy. It is also worth noting that the C++98 libraries have been significantly improved through the use of new language features, such as initializer-lists, rvalue references, variadic templates, noexcept, and constexpr. The C++11 standard library is easier to use and provides better performance that the C++98 one.
For a list of accepted libraries, see the library component list.”
So, I have read the first 36 pages and still need to cover 1332 pages.
Here are a couple of C/C++ funnies:
auto accident; register voters; static electricity; struct by_lightning; void *where_prohibited; char broiled; short circuit; short changed; long johns; long dong_silver; unsigned long letter; double entendre; double trouble; union organizer; union jack; float valve; short pants; union station; void check; unsigned check; union onion; more at GNU.org
Here is a fun piece of code to ponder (What is the answer here?):
int a = 5; int b = a++ + ++a;
And, lastly, something that many new programmers struggle with,
“To understand recursion, you must first understand recursion.” (See the