In The Beginning
Reading: Ch. 1-4, plus pp. 71 and 72.
The C language was
ATT Bell Labs during the 1970's
by Ken Thompson and Dennis Ritchie.
- C was created to write the Unix operating system.
- Intended to replace assembly language.
- As such, it is very low level. Tends to expose details of the
- Adds a minimum of overhead. Used when execution speed is important.
The C language is small, and it produces
efficient object programs. This makes it well-suited for
for small and slow computers.
- Unix was written for a minicomputer, the smallest sort of machine
available at the time.
- C was very well-suited for the original PCs.
- Very important for embedded systems.
C is widely used for system software, both operating systems and
networking servers. It is also still important on the desktop, though
it is just one of many there.
The New Class
In 1979, Bjarne Stroustrup at Bell Labs was studying
the problem of partitioning the Unix kernel code in order to
build a distributed system. Having previous experience with
the class construct, he developed
a tool to add
classes to C
to express the modular structure of the code he was studying.
This effort eventually grew into a new programming language.
- Originally: C++ meant C + classes.
- Over time, much more than that was added.
- C and C++ are separate languages, with C (mostly) a subset of C++.
- C++ is designed to be compatible, so a C program can be compiled
under a C++ compiler with minimal changes.
- Plain C is still widely used, particularly for system software (both
the OS and networking servers), and for embedded systems
where small size is essential
California Does Its Own Thing
Java was created in the 1990s,
for use in embedded systems.
Gosling is usually given as the primary designer, though others
were were involved.
- Largely a cleaned-up version of C++.
- Discarded compatibility with C, and most of C's older constructs.
- Fairly pure implementation of the OO paradigm.
- Portability is a primary goal, not run-time efficiency.
- Similar syntax to C++.
- Some rather subtle semantic differences.
The idea of generic programming is to
build a data structure
without knowing all of the types, so that the code
can then be reused with any or many data types.
Many languages support generic programming in some form, including
Java generics and C++ templates.
- Generics were not part of the original C++ design, but were
- They were part of the first official standard, in 1998.
- Also included was the Standard Template Library, which used
templates to provide a nice set of generic data structures.
The C++ standard continues to be updated. The latest
full standard was issued in 2011, amended in 2014. It includes such
- Language support for threading.
- Anonymous functions.
- Smart pointers which provide a form of automatic storage management.
- And much more.
C++ is a text-oriented language. It has no standard Graphical
User Interface library.
A C program types to the console and reads data from the keyboard.
No on had heard of a GUI. The user of a minicomputer typed text
commands on a console or terminal device, and read responses typed
by the computer.
C++ is still a text-based language. The original C had a very good
I/O system for printing and other features for using this environment well.
It is very good at flinging text around. C++ is even better.