Chapter 33 Further Reading

Official Documentation

  • Free Pascal Programmer's Guide — Units — The official documentation for unit syntax, compilation, and search paths. Covers every compiler directive related to units.
  • https://www.freepascal.org/docs-html/prog/progse3.html

  • Free Pascal Reference Guide — Programs, Units, Blocks — Formal syntax definitions for unit declarations, interface and implementation sections, and initialization/finalization.

  • https://www.freepascal.org/docs-html/ref/refch2.html

  • Lazarus Wiki: Creating Packages — Step-by-step guide to creating Lazarus packages (.lpk files) for distributing reusable components.

  • https://wiki.lazarus-ide.org/Creating_a_package

Books

  • Wirth, N. (1976). Algorithms + Data Structures = Programs. The foundational text by Pascal's creator. Chapter 1 discusses program decomposition and the relationship between data and algorithms — the philosophical foundation for modular design.

  • Parnas, D.L. (1972). "On the Criteria To Be Used in Decomposing Systems into Modules." Communications of the ACM, 15(12), 1053–1058. The landmark paper that established information hiding as the primary criterion for module decomposition. Every principle in Section 33.7 traces back to this paper.

  • Martin, R.C. (2017). Clean Architecture: A Craftsman's Guide to Software Structure and Design. Covers cohesion, coupling, the dependency inversion principle, and the acyclic dependencies principle in depth. Language-agnostic but directly applicable to Pascal unit design.

  • Cantu, M. (2016). Object Pascal Handbook (Delphi 10 Seattle edition). Chapter on units and packages covers Delphi-specific extensions (packages, BPLs) that are partially applicable to Free Pascal.

Online Resources

  • Free Pascal Wiki: Unit — Community-maintained reference for unit creation, compilation order, and common pitfalls.
  • https://wiki.freepascal.org/Unit

  • Lazarus Online Package Manager (OPM) — Browse available packages to see how the community structures reusable libraries.

  • Available through Lazarus IDE: Package → Online Package Manager

Connecting to Other Languages

The concepts in this chapter map directly to other languages' module systems:

Pascal Concept Python Java C/C++ Rust
Unit Module (.py file) Class in package Header + source file Module (.rs file)
Interface section Public functions/classes public members Header file (.h) pub items
Implementation section Non-exported functions private members Source file (.c/.cpp) Non-pub items
Uses clause import import #include use
Initialization Module-level code Static initializer Constructor (C++) lazy_static!
Dynamic library .so/.pyd JAR .dll/.so .so/.dll

Understanding Pascal's explicit interface/implementation separation prepares you for all of these systems.