Running Example

Throughout the book, I’ll show you how to reuse code written mostly in the C language and occasionally in Python. For that, we’re going to need a running example. We’ll start with a program in C that isn’t necessarily unstructured, cluttered, or hard to maintain, but it’s also not designed to be reused in the future. We’ll slice, dice, and even tear this program apart and put it on different computers to make the code more reusable.

Interestingly, you don’t even need to know anything about the problem that the program solves to understand the reuse mechanisms. A differential equation solver is as good as a web browser, which, in turn, is as good as a program that controls a unicorn feeder. So, let’s pick a common problem that ...

Get Resourceful Code Reuse now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.