C vs. Python

Resourceful Code Reuse — by Dmitry Zinoviev (8 / 20)

The Pragmatic Programmers
The Pragmatic Programmers

--

👈 Introduction: Why Reuse Code? | TOC | Running Example 👉

You’ll see that C and Python software each require different code reuse techniques.

C programs are usually compiled — they’re converted into files that contain native CPU instructions with little or no “memory” of the original development language. These converted files are relatively language-agnostic and can be combined with other files developed in other compiled programming languages (such as C++ or Rust). It makes sense then to organize them into libraries for further reuse.

Python programs are usually interpreted by an interpreter or byte-compiled — they’re converted into files that contain instructions for a virtual machine. These converted files have more limited reusability, get along only with other Python files, and often have to be byte-compiled again before reuse. This limitation makes building complex shared Python libraries impractical.

👈 Introduction: Why Reuse Code? | TOC | Running Example 👉

Resourceful Code Reuse by Dmitry Zinoviev can be purchased in other book formats directly from the Pragmatic Programmers. If you notice a code error or formatting mistake, please let us know here so that we can fix it.

--

--

The Pragmatic Programmers
The Pragmatic Programmers

We create timely, practical books and learning resources on classic and cutting-edge topics to help you practice your craft and accelerate your career.