Things That I Keep Coming Back To
There are a few things that seem to have an inevitable intellectual gravity that for some reason I can't shake free.
- Stack machines for building domain specific languages
- Objects as a method of encapsulation for behavior
- Grammar as the basis of structuring relationships between words
- Syntax as the ordering of application of those relationships
- Vocabulary as the core of good programming
I'd say these things are increasing order of abstractness. They are all, however, defined by particular structural elements of the problem space:
- programs are represented as a linear sequence of symbols
- the groupings of symbols define context through aggregation
- these symbols also have different morphologies with corresponding semantics
- apposition of symbols implies relationships between the different semantic elements, giving rise to novel meanings
- the semantics across multiple groupings of behavior partitions the problem space into parallel sub domains with idiosyncratic behaviors
Or in simpler words:
- we read words left to right top to bottom
- words are associated together in groupings to describe things
- different words relate to different types of things, actions, and qualities
- by putting words together in different orders we can create meanings different from the meanings of any one word
- if we use words the same way most of the time, we can produce subtle meanings, nuance
This is a sort of calculus of language. Stack machines are useful because while linearly parsing a stream of words, it allows us to remember what came before in a most recently referenced fashion, first in last out. Other structures don't match the temporal bias of language, where immediacy takes precedence. Look at Ciceronian Latin, and you will see language which always bore it's emphasis on the last word. As Nietzsche did with run on sentences and nicht. Objects are little bundles of relationships which are modeled as collections of method names. Methods either describe the properties or capabilities of an object. If the word choice is congruent with our real world mental map, an object creates an illusion of familiarity.
Grammar and syntax define how language is structured. Nouns represent concrete things or ideas. Nouns are good names for objects. Verbs represent actions or states of being. They make for great method names. Adjectives and adverbs describe other nouns and verbs. Most programming languages struggle with these. Most treat them as compiler directives, occasionally nouns, and often methods. Sometimes we ignore them entirely. Pronouns create relationships between predicates. Most programming languages use them for special forms like flow control constructs. Quite frankly most programmers have no training in this most critical field and it shows.