Naming things

There are only two hard things in Computer Science: cache invalidation and naming things.

probably Phil Karlton

Some people complain about systems which adopt idiosyncractic names for things. car and cdr (and sometimes even cons) in Lisp are frequent targets. Here’s someone complaining about TeX’s ‘overly-cute jargon, like “glue”.’

The core of the problem Karlton refers to in the quote above is that the English language often applies the same word to things which would definitely be better modelled as very distinct entities in a computer system. My favourite example is a booking system for train tickets. A ‘train’ could be:

If you’re writing a program that deals with trains and train timetables in any way, it makes sense to give each of these meanings of ‘train’ a different name and maybe even not to give the name ‘train’ to any of them.

In the case of TeX’s glue, the term ‘space’ has multiple meanings in typography: it could be a space character (of any of several types — non-breaking, thin, etc.), for example. Andrew Young suggests ‘leading’, but this is too specific, referring in classical typography only to strips of lead inserted between lines to increase the spacing. It makes sense to invent an idiosyncratic term for the concept as it is idiosyncratically understood by TeX.

In developing Green’s Dictionary of Slang Online, I had a similar problem about the word ‘citation’. In most historical dictionaries, quotations consist of a citation and a text, but GDoS uses ‘citation’ to refer to both the quotation and the citation (in the terms of other dictionaries). To match citations (in the common meaning) to the bibliography, I created a data structure initially called a ‘matched citation’, but I later called it a ‘stencil’ in reference to the terminology used by the Middle English Dictionary (and occasionally, but rarely, by others).