# C++: From a PhD program to Arduino and the printer I assembled

> He sped up his program and made his own life harder. The story behind C++, and how it connects to Arduino and a printer I assembled.

*2026-11-03T13:20:54Z*

He sped up his program, but made his own life harder. How?

Imagine making your program run faster, then feeling lost every time you return to fix it. That is the tradeoff in Stroustrup’s PhD story, by his own account. Years later, the language that grew from that question became a way to write Arduino sketches.

Code can leave the screen and make something move!

## In 60 seconds

By his own account, Stroustrup wrote a PhD simulator in Simula. It helped him organize the program, but it ran too slowly. Rewriting it in BCPL made it fast enough, while writing and debugging it became painful. In 1979 at Bell Labs, he began working toward structure and speed together. C with Classes came first; the name C++ followed in 1983. Today, we use C++ for Arduino sketches that can control physical movement.

## Whose account is this?

The PhD story comes from Stroustrup himself: *A History of C++: 1979–1991*, especially section 2.1 on printed page 3, and his interview published in 1996. These are two tellings by the same person, rather than independent witnesses. That is why the attribution matters.

Bell Labs confirms the 1979 start and the aim of combining Simula’s abstraction with C’s efficiency. Its biographical paragraph conflicts with his account about where he earned his PhD; that paragraph is not used here.

## Before Bell Labs: faster program, harder life

By his own account, Simula helped him organize his PhD simulation, but execution was too slow for the job. The BCPL rewrite ran fast enough and rescued the project, while making the coding and debugging painful.

Like widening a road, then removing every road sign!

That is our analogy, not his quotation. The story concerns this particular program and implementation. It does not establish that every Simula program is slow, or that his doctorate failed.

## 1979: why choose?

At Bell Labs, he wanted structure and execution speed together. He began adding Simula-style classes to C.

A useful first explanation is that a class groups data with the operations that work on it. That is a logical grouping; it does not require every function definition to sit physically inside the same block. It also does not describe everything modern C++ has become.

## From C with Classes to C++

Work began as C with Classes in 1979. According to Stroustrup’s FAQ, the name C++ arrived in late 1983. This was an evolution over years. The name was not there on day one, and Arduino was not part of the original story.

## Then the code left the screen

Arduino’s build documentation explains how preprocessing turns a sketch into a C++ program. The page describes AVR targets and says other architectures follow a similar process. That supports saying we write Arduino sketches in C++; it does not mean any desktop program runs unchanged on any board.

The official Stepper library gives us a concrete example: code controlling a stepper motor with suitable hardware. The board provides control signals; this is not an instruction to power a printer motor directly from an I/O pin.

Like the Arduino Mega wired into the printer I assembled. That is my personal connection to the story: I assembled the printer from a kit, and its wires go to an Arduino Mega. That does not identify its installed firmware.

## Where do 3D printers fit?

Marlin is a documented example of printer firmware using C++, built around the Arduino framework. It runs on the printer’s mainboard and manages heaters, steppers and sensors. It is a general example, not a claim about what runs on my printer.

The control software also differs from the instructions for each print. Marlin processes G-code produced by the slicer. Using C++ in firmware does not mean writing every print job in C++.

## Learn it if

Learn it to program Arduino, drive motors, and program 3D printers. That makes the connection tangible: a line of code, a signal, and something moving in front of you.

## Frequently asked questions

### Was C++ invented for printers?

No. The early motivation concerned structure and efficiency in systems and simulation work. Arduino and printers are later applications here.

### Do I need C++ just to print a model?

No. Using a slicer and sending print instructions is different from developing the control software.

### Does my printer run Marlin?

These sources do not establish that. An Arduino Mega alone cannot identify the installed firmware.

## Sources

- [Stroustrup: A History of C++, sections 2.1–2.2 and printed page 6](https://www.stroustrup.com/hopl2.pdf)
- [Stroustrup interview, winter 1996](https://stroustrup.com/gillies.htm)
- [Bell Labs: The rise of C++](https://www.nokia.com/bell-labs/about/history/innovation-stories/rise-c-plus-plus/)
- [Stroustrup: When was C++ invented?](https://www.stroustrup.com/bs_faq.html#invention)
- [Arduino: Sketch build process](https://docs.arduino.cc/arduino-cli/sketch-build-process/)
- [Official Stepper library](https://github.com/arduino-libraries/Stepper)
- [Marlin introduction](https://marlinfw.org/docs/basics/) and [code structure](https://marlinfw.org/docs/development/code_structure.html)

To see the other end of this story, [here is the printer I assembled from a kit](https://fadymondy.com/en/blog/built-3d-printer-from-kit).

---

Source: https://fadymondy.com/en/blog/cpp-history-from-phd-to-arduino
