console.log, a function for printing a value to the console.
'HELLO IS THIS RUNNING?!?!'.
Even if you write
console.log many times a day, you probably haven’t stopped to think about how the words ‘console’ and ‘log’ ended up in a programming language. Isn’t ‘console’ something you do when someone is upset? Isn’t a ‘log’ something you put on a fire?
Let’s take an etymological stroll through history and see what we can find. Our journey will take us from the early days of computing to medieval churches to the high seas, and we’ll learn that the seemingly unrelated definitions of these words have more in common than you might think.
The definition of console as a software feature comes from the early days of computing, when a user interacted with a computer mainframe (which was often very large and possibly located in another room or building) via an array of controls set in a desk.
Early computer consoles were controlled by switches and buttons, while output was relayed to the operator via lights, dials, and paper printouts. Over time, consoles evolved to incorporate a command-line interface on a screen, with which the user would enter instructions using a keyboard.
We can find analogs of the computer console by looking to the world of music. Sound mixing consoles have existed in one form or another since the advent of electrical audio recording and broadcast almost a century ago.
But the use of the word console to describe a panel of electrical controls can be traced even further back, beyond the discovery of electricity itself, to the pipe organ.
The pipe organ is the largest musical instrument, and is played by an organist who sits at a complex array of controls called a console. Organ consoles consist of keyboards (typically three to five), pedals, and stops - binary valves used for controlling wind flow to the pipes.
Organ consoles give us another everyday term: the idiom ‘pulling out all the stops’, meaning to apply maximum effort to a task. When every stop on the console is open an organ will produce sound using every available pipe, and therefore at maximum volume.
But where did this type of console get its name? One clue lies in the fact that many organ consoles share a design feature with the console table. Modern console tables are typically four-legged, free-standing structures designed to abut a wall. But if we go back a few centuries, we find that console tables were more commonly wall-mounted with brackets beneath the table surface to bear the load.
These supporting brackets are where the console table, (and perhaps the organ console) gets its name. In architecture, a console refers to an ornamental bracket that supports a protruding structure, such as a ledge, cornice, or balcony.
At this point, our etymological path forks. An architectural console may get its name from the verb ‘to console’: literally con solaris or ‘with soothing’; a relieving of pain or, perhaps, of weight. You could consider the job of a console to ‘relieve’ the weight of the structure above it.
An alternative explanation takes us back to the church, where in medieval times choir stalls were decorated with carved male figures called consolateurs or ‘consolers’. This in itself may have been a pun on the fact that consolers were often carved into armrests, thus supporting the weight of a seated chorist’s arms.
So, far from being coincidental homonyms, it turns out that the many definitions of ‘console’ share a common etymological root, even when it’s used as a verb. Does the same go for ‘log’?
In computing, the term ‘log’ derives from a ship’s log, which is short for ‘logbook’. A logbook is used for recording information about any event taking place aboard a vessel, from navigation to maintenance to changes in crew. While there are typically no restrictions about what can be recorded in a logbook, the name comes from a very specific use: recording the ship’s speed.
Long before the invention of modern instruments, such as GPS, recording speed was an essential part of navigating the seas. Sailors would measure their speed and record it in the logbook every half hour, and by knowing how fast they were going, combined with the direction in which they were traveling (measured using a compass), they could work out where they were on the map.
The logbook got its name from the chip log, a device that sailors used to measure the ship’s speed. This consisted of a quarter-circle piece of wood (the ‘chip’) with a rope tied to it, in which knots were tied at regular intervals.
A sailor would throw the chip overboard and count how many knots spooled out while another sailor timed him using a sand timer. When the timer was up, the number of knots that had passed over the stern could be used to calculate the ship’s speed, which was then recorded in the logbook. This is where we get the term ‘knot’ as shorthand for 1 nautical mile per hour.
Before the invention of the chip log, an even more rudimentary technique for gauging speed was the Dutchman’s log. One sailor would throw any floating object (probably an actual log) over the bow of the ship while another sailor on the stern timed how long it took for the object to pass him. With this measurement (and knowing the length of the ship), the sailors could make a rough estimate of how fast they were travelling.
The days of using a log to measure a ship’s speed lie centuries behind us, but ‘log’ is a ubiquitous term in modern life thanks to its importance in computing (just think how many times you ‘log in’ to various pieces of software every day). And it’s just one of many modern definitions whose origins lie in our civilization’s long maritime history. We don’t need to look far to find more: the word ‘cyber’ derives from the ancient Greek word kubernētēs, meaning steersman or rudder, and the word ‘gadget’ was a slang term used by sailors for any part of a ship that they couldn’t remember the correct name of.
So next time you write
console.log in your editor, spare a thought for the computer pioneers, pipe organists, medieval carvers, and old-word mariners who played a small part in giving us the very modern definitions of these two words.
If you enjoyed this, you may want to read Your creations will not outlast you.