C Programming Tools Third Lecture: 28th May 2020


d.white@imperial.ac.uk

I am about to give the third lecture of my 4 first year lectures on C Programming Tools, building a toolbox of useful tools, and the craft skills to use them effectively, in order to make C programming easier.

The third lecture covers the following topics:

  • Building your own tools - aka, what to do if the tool you want doesn't exist: consider building it yourself, to save time over the long term. Core principle: Spot patterns, bore easily, automate, save time!
  • Build tools at a range of scales:
  • Tiny: Build shortlived tools (eg Perl one liners or awk/sed/grep pipelines, or their C equivalents), short throwaway programs that you write in minutes, use for minutes and then discard. Examples: generating repetitive output from simpler input forms.
  • Medium: Generating C prototypes automatically: a tool called proto that I wrote a long time ago to solve a problem that irritated me.
  • Medium: Build/find a collection of ADT modules (hashes, sets, lists, trees etc), well tested, general purpose, that you know well.
  • Large: Why not generate ADT modules automatically from Haskell style "inductive data declarations": my tool called datadec.


Here are the lecture materials, covering the lecture and associated examples (of which there are many). Please note that these may be regenerated several times before the lecture is released.

  • Here are the full size lecture notes (PDF), ie. with one slide per page.
  • Here are the 4-up lecture notes (PDF), ie. with 4 slides per page.
  • And here's the C Tools tarball, as a gzipped tar file:

  • d.white@imperial.ac.uk
    Updated: May 2020 
    Back to my C Tools Lectures Pages.