3 ms·
C++ was based on Stroustrup's early-1970s experience with Simula, where he was able to write a beautiful program (for his thesis research, I think?) that did ex
by kragen 15y ago
C++ was based on Stroustrup's early-1970s experience with Simula, where he was able to write a beautiful program (for his thesis research, I think?) that did exactly what he needed, but then discovered that doing the compute run he wanted to do would consume his department's entire computation-time budget on the mainframe. (Apparently 80% of the compute time was being spent in the garbage collector, even after he stopped allocating new objects, which sounds like a straight-up bug in the Simula runtime.) So he rewrote the program in BCPL, which is about like Forth except that it has infix notation and doesn't have metaprogramming.
So, some years later, in 1983, his key consideration in the design of C++ was efficiency — avoiding imposing any unnecessary overhead.
http://www.stanford.edu/class/cs106l/course-reader/Ch0_WhatIsCpp.pdf http://www.stanford.edu/class/cs106l/course-reader/Ch0_WhatI...
In the interim, although he didn't know this, generational garbage collection and inline method caches had been invented, which probably would have provided enough efficiency that he never would have had to switch to BCPL. (Actually, even a decently implemented early-70s Simula would have been five times faster, and that might have sufficed.)