Lesson 1: Your first program: running code and reading what it prints
A program written before any computer existed
Long before electricity ran any computer, Charles Babbage designed a calculating machine of gears and rods, the Analytical Engine, and never finished building it. Ada Lovelace published a set of Notes about it. They set out, one operation after another, how the machine could solve certain mathematical problems. Nothing existed that could run those steps. Yet they were complete, exact and in order, and the Computer History Museum says she is often called the first programmer.
Why it fits here: Her Notes were a program in the plain sense used here: a list of exact steps, in order, for a machine to follow.
Source: Computer History Museum: Ada Lovelace
Topic: What a program is · history, people
A loom that read holes in cards
Around 1801, Joseph Marie Jacquard built a loom whose pattern was controlled by cards. Holes punched in each card decided which threads were raised for one pass of the shuttle. A chain of cards, read in order, became the whole pattern, so changing the cloth meant changing the cards and not the loom. A silk portrait of Jacquard himself, woven in 1839, needed 24,000 punched cards.
Why it fits here: The cards were a program: instructions prepared in advance and followed in order, one card at a time, like statements from the top down.
Sources: Computer History Museum: 1801, punched cards control Jacquard loom; Wikipedia: Jacquard machine
Topic: What a program is · history, machines
The first hello, world
The best-known first program in the world prints two words: hello, world. Its first known version is in a tutorial that Brian Kernighan wrote in 1972 for a language called B. That program kept the greeting in three small pieces, hell, then o, w, then orld, and printed them one after another. Printing a short line is still how most people test a new language.
Why it fits here: It is the same act as the first line here: one instruction whose whole job is to print a line of output.
Sources: Wikipedia: Hello, World! program; Bell Labs: A Tutorial Introduction to the Language B, by B. W. Kernighan
Topic: Printing numbers and doing sums · history, languages
When a computer was a person
For about three hundred years a computer was a person whose job was to do sums. Katherine Johnson was one at NASA. In 1962 the astronaut John Glenn was about to orbit the Earth, on a path worked out by new electronic machines. The astronauts were wary of putting their lives in the care of those machines. Johnson was called upon to check the work, and the flight went ahead.
Why it fits here: Her job was what console.log does with a sum: exact arithmetic, in a fixed order, with the answer written down.
Sources: NASA: Katherine Johnson biography; Wikipedia: Computer (occupation)
Topic: Printing numbers and doing sums · history, people, space
A spacecraft lost to two kinds of number
NASA built the Mars Climate Orbiter to study Mars from orbit. It never did. Two pieces of software had to pass numbers to each other. The software on the ground used English units. The software on board worked in metric. Each number looked fine alone, yet it meant something different on the other side. A navigation error followed, and the mission failed.
Why it fits here: A value is more than its digits: its kind decides what it means, as with a string and a number here.
Source: NASA: Mars Climate Orbiter
Topic: Text and numbers are different kinds of value · space, mistakes
A number too big for its box
The first Ariane 5 rocket of the European Space Agency failed soon after it left the ground. The inquiry found errors in the software of the system that told the rocket which way it was pointing. One value was held as a 64-bit number, with room for huge amounts. The program converted it into a 16-bit number, a far smaller box. The value did not fit, and the guidance information was lost.
Why it fits here: Turning one kind of value into another is a real step that can go wrong, which is why it is done on purpose here, with Number(...).
Sources: European Space Agency: Ariane 501, presentation of the Inquiry Board report; Wikipedia: Ariane flight V88
Topic: Text and numbers are different kinds of value · space, mistakes
The equals sign has an inventor
The equals sign has an inventor and a birthday. The Welsh mathematician Robert Recorde first used it in 1557, in a book called The Whetstone of Witte. Before that, anyone doing sums had to write the words is equal to in full, line after line. Two short strokes took their place, and more than four and a half centuries later they are on every keyboard.
Why it fits here: Recorde's sign states that two sides are equal; in a program the same sign gives an order, is set to, so the difference needs saying.
Sources: Wikipedia: Equals sign; MacTutor History of Mathematics: Robert Recorde
Topic: Giving values names · history, maths, people
A name for a number that never changes
Some values never change, and people name them once and for all. The best known is the number you get when you divide the distance round any circle by the distance across it. In 1706 the Welsh mathematician William Jones used the Greek letter π for it, in a book based on his teaching notes for beginners. The name stuck, and it has saved the writing of endless digits ever since.
Why it fits here: It is what const does: one fixed value gets one name, and every later line uses the name.
Sources: Wikipedia: Pi; MacTutor History of Mathematics: William Jones
Topic: Giving values names · history, maths, people
The bug that was a real moth
A fault in a program is called a bug, and one famous bug was a real insect. Around 1947, operators of an early computer at Harvard traced a problem to a moth caught in the machine. They taped the dead moth into the logbook for the computer. The Computer History Museum marks 9 September as the day of the first actual computer bug being found.
Why it fits here: The operators did what is taught here: they found the exact thing that stopped the work, wrote it down, and fixed that one thing.
Sources: Computer History Museum: September 9, first instance of actual computer bug being found; Wikipedia: Bug (engineering)
Topic: Reading your first error messages · history, words
Paid for every error found
Donald Knuth writes famous books about programming, and he still expects mistakes in them. So he pays for them. The first person to report a real error is entitled to a reward of at least 2 dollars and 56 cents. The odd sum is 256 cents, which he calls one hexadecimal dollar: a dollar counted in sixteens, the way computers like to count.
Why it fits here: Even an expert's work holds errors; what matters is the habit taught here: read the report, find the exact slip, fix it.
Sources: Donald Knuth's own page: The Art of Computer Programming and other books; Wikipedia: Knuth reward check
Topic: Reading your first error messages · people, books
Lesson 2: Reading error messages, in the terminal and in the browser
Why a terminal is still called a tty
The first terminals had no screen. They were teletypewriters: machines like typewriters, first used to send telegrams over wires. When people began to type commands to a computer, these machines became its input and output devices, because they were already on sale. The computer's answer came back printed on paper, a line at a time. The name stayed. On Linux today a terminal is still a tty, short for teletypewriter, and a command called tty prints the name of the terminal in use.
Why it fits here: The terminal window on the screen copies those machines: a line is typed, and the answer is printed below it.
Sources: Wikipedia: tty (Unix); Linus Akesson: The TTY demystified; Wikipedia: Computer terminal
Topic: Running a file in a terminal, and reading Node's report · history, machines, words
The little arrow means it lacks
The mark ^ under an error has a name, the caret. The word is Latin and means it lacks, or there is lacking. Proofreaders use a caret when they check printed pages. They put it at the place where a word or a letter is missing, to show that something must be inserted there. Node uses the mark in the same spirit: the caret sits under the spot where the line stopped making sense.
Why it fits here: A caret in an error report points at the exact spot, as a proofreader's caret points at the gap in a line.
Sources: American Heritage Dictionary: caret; Oxford Learner's Dictionaries: caret; Wikipedia: Caret
Topic: Running a file in a terminal, and reading Node's report · words, history
The engine that left the browser
JavaScript is best known as the language of web pages, where an engine inside the browser reads it and runs it. Chrome's engine is called V8. In 2009 a programmer named Ryan Dahl wrote Node.js around that engine, so that the same language could run with no browser at all: from a terminal, on a file. Node's own guide still says it in one line. Node.js runs the V8 JavaScript engine, the core of Google Chrome, outside of the browser.
Why it fits here: The command node on a terminal line starts this very engine, on the file named after it.
Sources: Node.js: Introduction to Node.js; Wikipedia: Node.js
Topic: Running a file in a terminal, and reading Node's report · history, tools, people
A rocket lost to one missing bar
On 22 July 1962 NASA launched Mariner 1 towards Venus. It veered off course, and a safety officer destroyed it 293 seconds after launch. One cause was a tiny slip in the guidance program. An equation had been written by hand with a small bar over the letter R. When the equation was turned into code, the bar was left out, so the computer steered by moment-to-moment values in place of smoothed ones. The writer Arthur C. Clarke called it the most expensive hyphen in history. NASA notes that the missing mark was not a hyphen at all.
Why it fits here: One small mark can change what a program means. JavaScript's reader stops at the marks it can tell are missing, before anything runs.
Sources: NASA Science: Mariner 1; NASA Space Science Data Coordinated Archive: Mariner 1; Wikipedia: Mariner 1
Topic: The SyntaxError family · space, mistakes, history
Syntax is Greek for putting in order
The word syntax is far older than computers. It comes from ancient Greek, where syn means together and taxis means arrangement. The Greek verb behind it means to put in order. For a very long time the word belonged to grammar: the rules for the order of words in a sentence. Dictionaries now give it a second meaning as well: the rules for forming statements in a programming language. A SyntaxError, then, is an error of order.
Why it fits here: Each SyntaxError message is about order: a piece of code came where the rules of the language did not allow it.
Sources: American Heritage Dictionary: syntax; Wikipedia: Syntax
Topic: The SyntaxError family · words, history
The billion-dollar mistake
The idea of a name that refers to nothing has an inventor, and he is sorry for it. In 1965 the British computer scientist Tony Hoare was designing a language called ALGOL W. He added the null reference, a way for a name to refer to nothing, because it was so easy to build. At a conference in 2009 he called it his billion-dollar mistake. He said it had led to countless errors and crashes over forty years.
Why it fits here: The message Cannot read properties of null is this old idea at work: a name that refers to nothing was asked for something.
Sources: InfoQ: Null References, The Billion Dollar Mistake (Tony Hoare's talk); Wikipedia: Tony Hoare
Topic: Messages from a running program · history, people, mistakes
A bug too old to fix
Ask JavaScript what kind of thing null is, with the word typeof, and it answers object, its name for a bundle of values. The answer is wrong, and it is a well-known bug. It comes from the first JavaScript ever written. Each value was stored with a small tag that told its type, and the tag for objects was 0. Null was stored as a plain zero, so it looked like an object. A fix was proposed years later and was rejected. It would have changed the answer to null.
Why it fits here: The messages of this topic speak of undefined and null, the two empty values. This bug shows how null was stored in the first JavaScript.
Sources: MDN: typeof; Alexander Ellis: typeof null, investigating a classic JavaScript bug
Topic: Messages from a running program · history, languages, mistakes
The video that outgrew its counter
YouTube once counted the views of a video with a 32-bit integer, a whole number kept in a fixed amount of memory. The largest value it could hold was 2,14,74,83,647, about 214.7 crore. Nobody expected a video to be watched that many times. Then the song Gangnam Style was. In December 2014 YouTube announced that the video had passed the limit. Its engineers had seen it coming and had already changed the counter to a 64-bit integer, which can count past nine quintillion.
Why it fits here: A RangeError is the same trouble met in time: a number is asked to go beyond what its place can hold.
Sources: BBC News: Gangnam Style music video 'broke' YouTube view limit; Wikipedia: Gangnam Style
Topic: Messages from a running program · internet, numbers, mistakes
Firebug, the tool that started it
Early web developers hunted for bugs the slow way: they commented out code and tried again. In January 2006 Joe Hewitt, one of the makers of Firefox, released a small add-on called Firebug. Its first version was a single console panel, and his note with it said that the code was only a few days old. Mozilla calls Firebug the first tool that let programmers inspect, edit and debug code right in the Firefox browser. Developer tools are now a built-in part of every large browser.
Why it fits here: The console in today's browsers does the job that Firebug's first panel did: it shows a page's messages and errors as they happen.
Sources: Mozilla Hacks: Saying goodbye to Firebug; Wikipedia: Firebug (software); Wikipedia: Web development tools
Topic: The browser's console · history, tools, people
The oldest engine was rewritten at home
The engine inside Firefox, SpiderMonkey, is the oldest of them all. It was the first JavaScript engine, written by Brendan Eich, the man who created the language. He has told the story himself. The first version, called Mocha, took ten days in May 1995 and was written in a hurry. Later he stayed home for two weeks and rewrote Mocha as the code that became SpiderMonkey. He did it partly as a small strike against managers who gave JavaScript too little support.
Why it fits here: Chrome, Firefox and Safari each have an engine with a history of its own, which is why each words the same error in its own way.
Sources: Brendan Eich: New JavaScript Engine Module Owner; Wikipedia: SpiderMonkey
Topic: The browser's console · history, people, languages
A help site named after an error
Stack Overflow, a question and answer site for programmers, is named after an error. A program keeps a stack, a pile of the jobs it has begun and not yet finished. When the pile needs more room than it has, the stack is said to overflow, and the program usually crashes. Jeff Atwood and Joel Spolsky created the site in 2008. They did not pick the name alone. The readers of Atwood's blog, Coding Horror, chose it by vote in April 2008.
Why it fits here: The site is one of the places where the good answers to error messages live, and its own name is an error.
Sources: Jeff Atwood, Coding Horror: Introducing Stackoverflow.com; Wikipedia: Stack Overflow; Wikipedia: Stack overflow
Topic: Searching for an error message · internet, history, words
Explain it to a rubber duck
Programmers have a famous trick for getting unstuck, and it needs a toy. Put a rubber duck on the desk. Explain to the duck what the code is supposed to do, then go through the code line by line. At some point you say what a line does, and you notice that it is not what the line really does. The duck has said nothing at all. The name comes from a story in a book, The Pragmatic Programmer, by Andy Hunt and Dave Thomas.
Why it fits here: Writing a good question does the same work: by the time the four things are written down, the answer often shows itself.
Sources: rubberduckdebugging.com; Wikipedia: Rubber duck debugging
Topic: Searching for an error message · people, books, tricks
MDN began as a wiki called DevMo
MDN, the reference that this topic sends a search to first, has a history of its own. Mozilla, the maker of Firefox, launched it in 2005 as a wiki named DevMo. A wiki is a site that its readers can edit, so the pages were written by a community. In 2010 it was renamed the Mozilla Developer Network, MDN for short. From 2017, other large technology companies began to write for it and to support it as well.
Why it fits here: MDN's page for each JavaScript error is the first place to read about a message, and many hands keep its pages right.
Source: MDN: About MDN
Topic: Searching for an error message · internet, history
Lesson 3: The debugging method, and cutting a bug down
A method in four lines, from 1945
In 1945 the mathematician George Pólya published a small book called How to Solve It. It begins with a short checklist of four phases for solving a problem in mathematics. Understand the problem. Make a plan. Carry out the plan. Look back. He added that the phases are not rigid: a solver may move back and forth between them. The book has sold over a million copies and has been translated into more than 15 languages.
Why it fits here: The six steps of debugging follow the same path: understand the bug, plan one test, carry it out, and look back to check the fix.
Sources: Wikipedia: How to Solve It; MacTutor, University of St Andrews: George Pólya
Topic: The method: six steps for any bug · history, maths, books, people
Bugs are older than computers
The word bug for a fault was not born with computers. Engineers were using it in the 1870s. In 1878 the inventor Thomas Edison wrote to an associate about his work. First comes the idea, he said. Then the difficulties arise, and bugs, as such little faults and difficulties are called, show themselves. So when a dead moth was found in a relay of a Harvard computer in 1947, the word was already waiting for it.
Why it fits here: Step one of the method is to find the bug before fixing anything, and the word itself comes from engineers who hunted faults the same way.
Sources: IEEE Spectrum: Did You Know? Edison Coined the Term Bug; Wikipedia: Software bug
Topic: The method: six steps for any bug · history, words, people
Careful thought, and a few prints
Brian Kernighan is a computer scientist who worked at Bell Labs, and he is a co-author of the first book on the C language. In 1979 he wrote a guide for newcomers called UNIX for Beginners. The system had a special tool for examining failed programs, which he found rather hard to learn. Then he added a line that programmers still repeat. The most effective debugging tool is still careful thought, coupled with judiciously placed print statements. Judiciously means with good judgement.
Why it fits here: A labelled print before the suspect line and one after it are what he meant: few prints, each placed with thought.
Sources: UNIX Programmer's Manual, Seventh Edition, Volume 2A: UNIX for Beginners; Wikiquote: Brian Kernighan
Topic: Printing to see, and tracing by hand · people, tools, history
The day a pioneer saw his future
Maurice Wilkes led the team that built EDSAC at the University of Cambridge, one of the first computers to keep its program in its own memory. It ran from May 1949. Wilkes later described a moment from that time. Walking between the computer room and the punching machines, he paused on the stairs. It came over him with full force, he wrote, that a good part of the rest of his life would be spent in finding errors in his own programs.
Why it fits here: Even the builders of the first computers had to hunt for their own slips, one value at a time, as a trace table does.
Sources: Wikiquote: Maurice Wilkes; Wikipedia: Maurice Wilkes; Wikipedia: EDSAC
Topic: Printing to see, and tracing by hand · history, people, machines
One wolf in Alaska
In November 1982 a one-page piece in the journal Communications of the ACM gave halving a name that stuck: the Wolf Fence algorithm. Its author, Edward Gauss, put it as a puzzle. There is one wolf in Alaska; how do you find it? First build a fence down the middle of the state, and wait for the wolf to howl. Now you know which side it is on. Do the same on that side only, again and again, until you can see the wolf.
Why it fits here: A print in the middle of a program is the fence, and the wrong value is the howl: it tells which half to search next.
Sources: ACM Digital Library: The Wolf Fence algorithm for debugging; Wikipedia: Debugging
Topic: Cutting a bug down · history, tricks, people
A tool that halves for you
Programmers keep the history of their code in a tool called Git, which saves each change as a step that can be visited again. Suppose a program worked last month and is broken today, with a thousand changes in between. Git has a command for this, git bisect. You mark one old step as good and one new step as bad. Git picks a step between the two and asks which it is. About ten answers are enough to reach the one change that brought the bug in.
Why it fits here: It is the halving of this topic, done by a machine: each answer rules out half of the changes that are left.
Source: Git documentation: git-bisect
Topic: Cutting a bug down · tools, tricks
The testing tool that was wrong
The Hubble Space Telescope was launched in April 1990. Two months later NASA announced that it was flawed: its pictures were blurred. The main mirror had the wrong curve, too flat near its outer edge. Investigators traced the cause to the device that had been used to test the mirror's shape while it was polished. Inside that device, the spacing of one lens was off by 1.3 millimetres. The mirror had been shaped with great care to match a faulty test. Astronauts fitted corrective optics in December 1993.
Why it fits here: The makers were sure of their testing device and did not test it. The fault sat in the one thing nobody doubted.
Source: NASA Science: Hubble's Mirror Flaw
Topic: Check what you are sure of · space, mistakes, history
Sleep on it: a measured effect
Taking a break is more than folk wisdom. In January 2004 the journal Nature published a study called Sleep inspires insight. People practised a task that held a hidden rule, a shortcut that nobody told them about. Then some of them slept for eight hours, and the others stayed awake. When all were tested again, more than twice as many of the sleepers had found the hidden rule. The authors concluded that sleep reworks what has just been learned.
Why it fits here: The advice in this topic to take a break when stuck has a measured effect behind it: rest can show what hard staring missed.
Source: Nature: Sleep inspires insight (Wagner and others, 2004)
Topic: Check what you are sure of · science, memory, tricks
The mistake no astronaut would make
Margaret Hamilton's team developed the flight software for the Apollo missions. Some evenings she brought her young daughter Lauren to work. One day Lauren, playing astronaut, pressed keys on the simulator and crashed it. She had started a program meant to run only before launch. Hamilton asked to add a safeguard. She was told that astronauts were too well trained to make such a mistake. On the very next mission, Apollo 8, an astronaut did exactly what Lauren had done, and the navigation data was wiped out.
Why it fits here: This is the awkward case of this topic: the one that seems too unlikely to check. A check for it would have cost a few lines.
Sources: The Guardian: interview with Margaret Hamilton, 2019; Wired: Her Code Got Humans on the Moon
Topic: Checking the fix · space, people, mistakes
Tests show bugs, never their absence
Edsger Dijkstra, a Dutch computer scientist, gave a famous lecture in 1972 called The Humble Programmer. One line of it is still quoted wherever software is tested. Program testing, he said, can be a very effective way to show the presence of bugs, but it is hopelessly inadequate for showing their absence. A test that fails proves that there is a bug. A test that passes proves only that this one case works.
Why it fits here: That is why a check uses several cases, and why the awkward ones matter most: each new case can only find a bug, never prove that none is left.
Sources: E. W. Dijkstra Archive: The Humble Programmer (EWD340); Wikiquote: Edsger W. Dijkstra
Topic: Checking the fix · people, history, science
Lesson 4: Reading the docs, and knowing your versions
The first Unix manual listed its own bugs
In the first two years of Unix, an operating system, no documentation existed at all. Then came the Unix Programmer's Manual, dated 3 November 1971, written by Dennis Ritchie and Ken Thompson. Its pages had a part called BUGS. One entry admitted that the clock counted sixtieths of a second in a number that would run out after only about 2.5 years. Ritchie later wrote that they had even anticipated the millennium bug.
Why it fits here: A good reference says what a tool does badly as well as what it does well, and that part is worth reading before relying on it.
Sources: Dennis Ritchie's pages at Nokia Bell Labs: the Unix Manual, first edition; Wikipedia: Man page
Topic: Reading a reference page · history, books, people
The first website was a manual
The web was born at CERN, a physics laboratory, and the very first website can still be visited there, at info.cern.ch. Its front page described the World Wide Web project itself: a plan to give universal access to a large universe of documents. Everything about the project was linked from that one page, from a summary to the mailing lists and a page of frequent questions. The first website was, in other words, the web's own documentation.
Why it fits here: The web began as a set of pages explaining how the web works, which is the kind of reference this topic reads.
Sources: CERN: info.cern.ch, home of the first website; CERN: the first website's front page, The World Wide Web project
Topic: Reading a reference page · history, internet
Eleven lines that stopped thousands of builds
In March 2016 a programmer, Azer Koçulu, removed more than 250 of his packages from npm, the store that JavaScript projects install code from. One of them was left-pad: a few lines that pad the left-hand side of a string with zeroes or spaces. Thousands of projects relied on it, Node and Babel among them, and they suddenly failed to install. The next year, ECMAScript 2017 gave every string its own method for the job: padStart.
Why it fits here: padStart is the method this topic reads through its syntax line. One method in the language now does what a whole package once did.
Sources: The Register: How one developer just broke Node, Babel and thousands of projects in 11 lines of JavaScript; Wikipedia: ECMAScript version history
Topic: Reading a syntax line · internet, tools, mistakes
Why counting starts at zero
On 11 August 1982 the Dutch computer scientist Edsger Dijkstra wrote a short note called Why numbering should start at zero. He compared four ways of writing a range of numbers and argued for one of them. Then he drew his conclusion: an element's number should equal the number of elements before it. The first one has nothing before it, so it is number 0. He called zero a most natural number.
Why it fits here: This is the reason at(index) and most other methods count from 0: the first character has no characters before it.
Sources: E. W. Dijkstra Archive: Why numbering should start at zero (EWD831); Wikiquote: Edsger W. Dijkstra
Topic: Reading a syntax line · history, maths, people
27 genes renamed because of a spreadsheet
Scientists keep lists of genes in spreadsheets, and Microsoft Excel kept reading some gene symbols, such as MARCH1 and SEPT1, as dates. By August 2020 the HGNC, the committee in charge of gene names, had renamed some 27 human genes to stop it: MARCH1 became MARCHF1 and SEPT1 became SEPTIN1. Even so, a 2021 report in Nature said that 30% of published papers still had mangled gene names in their extra data.
Why it fits here: Excel's guess works on ordinary text and fails on an edge case: text that looks like a date. Trying the edge cases of a tool shows such surprises early.
Sources: The Verge: Scientists rename human genes to stop Microsoft Excel from misreading them as dates; Nature: Autocorrect errors in Excel still creating genomics headache
Topic: Learning a new method in five minutes · science, mistakes, tools
A hammer, a feather and the Moon
At the end of the last Moon walk of Apollo 15, Commander David Scott tested an old idea live on television. He held out a hammer and a feather and let go of both at the same time. On the Moon there is almost no air to slow a feather down, so the two fell at the same rate, as Galileo had concluded hundreds of years before. A claim from the books was checked with one small experiment.
Why it fits here: It is this topic's routine on a grand scale: read a claim, then run a small test that shows whether it holds.
Source: NASA: The Apollo 15 Hammer-Feather Drop
Topic: Learning a new method in five minutes · space, science, history
There is no ECMAScript 4
JavaScript's standard is called ECMAScript, and its editions are numbered. The 3rd edition came out in December 1999 and the 5th in December 2009. There is no 4th. For over a year the committee was split between a large 4th edition and a smaller update of the 3rd. Brendan Eich, the creator of JavaScript, then announced a plan more modest than the 4th edition, and the 4th was abandoned. Some of its ideas came back years later, in the 6th edition.
Why it fits here: Version numbers do not always run one after another. Reading the real numbers, and never assuming them, is the habit this topic teaches.
Sources: Wikipedia: ECMAScript version history; Brendan Eich on es-discuss: ECMAScript Harmony; Brendan Eich: New JavaScript Engine Module Owner
Topic: Version numbers, and which version to use · history, languages, people
Node went from 0.12 straight to 4
In December 2014 a developer, Fedor Indutny, started a copy of Node called io.js, as an alternative with a more open way of running the project. For a while there were two versions of Node's code, and io.js reached version 3 while Node was still at 0.12. In September 2015 the two were joined again, and the combined release was called Node 4.0. So Node never had a version 1, 2 or 3 of its own.
Why it fits here: A jump in a version number has a story, and the release notes tell it. A careful developer reads them before moving to a new major version.
Sources: Wikipedia: Node.js; Node.js blog: Node v4.0.0
Topic: Version numbers, and which version to use · history, tools, people
The rules of a version have an author
The meaning of MAJOR.MINOR.PATCH did not grow up by chance. It is set out in a short specification called Semantic Versioning, SemVer for short, which anyone can read at semver.org. Its first author was Tom Preston-Werner, who also invented Gravatar and co-founded GitHub.
Why it fits here: Because the rules are written down for everyone, a version number can mean the same thing whichever tool it belongs to.
Source: Semantic Versioning 2.0.0, semver.org
Topic: Version numbers, and which version to use · tools, people
Almost every browser says it is Mozilla
Each time a browser asks for a page, it sends a line that names itself, called the user agent. Almost every browser today begins that line with Mozilla, for historical reasons. Netscape's early browser called itself Mozilla and could show frames, so websites sent frames only to browsers named Mozilla. Internet Explorer could show frames too, so it began to call itself Mozilla compatible, and the browsers after it copied the trick.
Why it fits here: Telling browsers apart by their names went so badly that the names stopped meaning much. Checking for the feature itself, with typeof, is the reliable way.
Sources: MDN: User-Agent header; WebAIM: History of the browser user-agent string
Topic: Will it work in every browser? · history, internet, words
The browser that once had 95% of the web
Internet Explorer, Microsoft's browser, won the first browser war against Netscape and became the most widely used browser of all, with about 95% of use by 2003. Microsoft later released Edge to succeed it. Support for Internet Explorer 11 officially ended on 15 June 2022, when Microsoft announced that it had retired.
Why it fits here: A browser can stay in use long after the language moves on, and the compatibility table is how a developer knows which features such a browser lacks.
Sources: Wikipedia: Internet Explorer; Microsoft, Windows Experience Blog: Internet Explorer 11 has retired and is officially out of support
Topic: Will it work in every browser? · history, internet, tools
Lesson 5: Searching well, judging answers, and asking for help
The first search engine came before the web
Before the World Wide Web existed, the internet already held files on many computers, and finding one was hard. Alan Emtage, a student at McGill University in Montreal, built a tool that kept an index of those files so that people could search it. He called it Archie, and it is widely considered the first internet search engine. Emtage was born in Bridgetown, Barbados, and joined the Internet Hall of Fame in 2017.
Why it fits here: Every search box since, including the one these operators are typed into, does the job Archie began: finding the one thing wanted in a huge collection.
Sources: Wikipedia: Archie (search engine); Wikipedia: Alan Emtage; Internet Hall of Fame: Alan Emtage
Topic: Making a search engine find exactly what you need · history, internet, people
Google is named after a number
Larry Page and Sergey Brin first called their search engine Backrub. Soon it was renamed Google, a play on the word for the number 1 followed by 100 zeros, a googol. That word is much older than Google. It was made up in 1920 by a nine-year-old boy, Milton Sirotta, the nephew of the American mathematician Edward Kasner.
Why it fits here: The search engine that most of these operators are typed into began with a playful name for a very large number.
Sources: Google: Our story; Wikipedia: Google; Wikipedia: Googol
Topic: Making a search engine find exactly what you need · history, internet, maths, words
Out of date on the day they were posted
Answers on Stack Overflow can go out of date as tools change. In 2019 a team of researchers studied such obsolete answers. More than half of them, 58.4%, were probably already out of date on the day they were first posted. And once an obsolete answer had been spotted, only 20.5% of such answers were ever updated.
Why it fits here: This is why a good answer must be recent enough and must survive your own test, whatever its votes say.
Source: arXiv: An Empirical Study of Obsolete Answers on Stack Overflow (Zhang and others)
Topic: Judging a source, and an answer · science, internet, mistakes
Wikipedia against Britannica
In December 2005 the science journal Nature published an investigation of the science entries in two encyclopaedias, Wikipedia and Encyclopaedia Britannica. It reported that Wikipedia came close to Britannica in the accuracy of its science entries. Britannica disputed the results and the way they were interpreted. Either way, both were judged by checking their entries against the facts, and not by their names.
Why it fits here: A source earns trust by being checked. The same holds for any answer met while searching: what does the evidence say?
Source: Nature: Internet encyclopaedias go head to head
Topic: Judging a source, and an answer · science, books, internet
The letter that brought the thumbs-up
A group of people who look after open-source projects once wrote an open letter called Dear GitHub. One complaint was that issues fill up with comments that say only +1, which serve only to spam the maintainers and everyone following the issue. On 10 March 2016 GitHub added reactions: small emoji, such as a thumbs-up, that anyone can add to a comment without writing a new one. GitHub said they would reduce the noise in long threads.
Why it fits here: That is why a thumbs-up, and not a +1 comment, is the polite way to say that an issue affects you too.
Sources: GitHub: dear-github, the open letter; The GitHub Blog: Add Reactions to Pull Requests, Issues, and Comments
Topic: Reading a project's bug list · internet, tools, history
Heartbleed, and the version that fixed it
In 2014 a serious bug was found in OpenSSL, a popular library of code for the encryption that secures connections on the internet. It was found independently by engineers at a company called Codenomicon and by Neel Mehta of Google Security, and it was named Heartbleed. Versions 1.0.1 to 1.0.1f were affected. Version 1.0.1g, released on 7 April 2014, fixed it, so the advice was short: use 1.0.1g or newer.
Why it fits here: An issue that names the fixing version gives the fastest answer of all: move to that version, and the bug is gone.
Source: heartbleed.com: The Heartbleed Bug
Topic: Reading a project's bug list · internet, mistakes, tools
The XY problem
Helpers have a name for a common trap: the XY problem. Someone wants to do X, does not know how, and guesses that some step Y will get them there. Then they ask only about Y. The helpers are puzzled, because Y seems a strange thing to want, and much time is wasted before the real goal, X, comes out. The idea goes back to Eric S. Raymond's guide, How To Ask Questions The Smart Way.
Why it fits here: A good question states the real goal, what was expected and what happened, so that helpers can see X and not only Y.
Sources: Greg's Wiki: XyProblem; Wikipedia: XY problem
Topic: Writing a question people want to answer · words, tricks, people
Why the example must be short
Programmers have a name for the small example that a good question needs: an SSCCE, a Short, Self Contained, Correct Example. The guide that explains it, at sscce.org, takes each word in turn: short, so the reader is not bored; self contained, so everything needed is included; correct, so it can be copied, pasted and run. It warns that on a public forum most readers stop reading by 100 lines of code. Stack Overflow calls the same thing a minimal, reproducible example.
Why it fits here: The smallest example of this topic is exactly this: short enough to read at once, and complete enough to run.
Sources: sscce.org: Short, Self Contained, Correct Example; Stack Overflow Help Center: How to create a Minimal, Reproducible Example
Topic: Writing a question people want to answer · words, tricks, internet
The most copied snippet had a bug
A study published in 2018 looked at how code from Stack Overflow ends up in projects on GitHub. At the top of its list of the most frequently referenced Java answers was a short method that turns a number of bytes into readable text, such as 1.0 kB for 1024 bytes. A 2019 report said it had been copied into more than 6000 GitHub Java projects. That year its own author, Andreas Lundblad, admitted that it was flawed and published a corrected version.
Why it fits here: Code that runs is not always right. Taking it apart and testing each piece is how such a flaw gets noticed before it is copied again.
Sources: arXiv: Usage and Attribution of Stack Overflow Code Snippets in GitHub Projects (Baltes and Diehl); arXiv: Usage and Attribution of Stack Overflow Code Snippets in GitHub Projects (Baltes and Diehl); ZDNet: The most copied StackOverflow Java code snippet contains a bug
Topic: Understanding an answer's code before you use it · internet, mistakes, tools
Unsafe code, copied into apps
In 2017 a team of researchers scanned about 13 lakh (1.3 million) Android apps on Google Play for code copied from Stack Overflow. They found that 15.4% of the apps held code about security taken from the site, and that 97.9% of those apps contained at least one insecure snippet. Their paper asked, in its very title, whether Stack Overflow should be considered harmful.
Why it fits here: Code that works can still be unsafe. Understanding each piece before using it is how the weak part gets noticed.
Source: arXiv: Stack Overflow Considered Harmful? The Impact of Copy&Paste on Android Application Security (Fischer and others)
Topic: Understanding an answer's code before you use it · science, internet, mistakes
Lesson 6: Using AI assistants well
ELIZA, the chatbot people trusted too much
Between 1964 and 1967 Joseph Weizenbaum at MIT wrote ELIZA, one of the first programs that people could chat with. Its best-known script played a therapist who reflects a patient's words back as questions, following rules written in the script. Weizenbaum meant to show how shallow the talk between a person and a machine was. Yet he was surprised to find that some people credited the program with human-like feelings. This came to be called the ELIZA effect.
Why it fits here: Fluent words make people believe that a program understands. It happened with ELIZA, and it is why an assistant's confidence must not be taken as evidence.
Sources: Wikipedia: ELIZA; MIT News: Joseph Weizenbaum, professor emeritus of computer science, 85
Topic: What an AI assistant is · history, people, machines
A lawyer, ChatGPT and six invented cases
In 2023 a lawyer in New York filed a brief in a case against the airline Avianca. Its research had been done with ChatGPT. The other side could not find several of the cases it cited, and the judge wrote that six of them appeared to be bogus decisions, with bogus quotes and bogus citations. The cases did not exist: the assistant had made them up. In the end the court fined the lawyers 5000 dollars.
Why it fits here: This is a hallucination with a real cost: fluent, confident and false. Looking up each case before using it would have caught it.
Sources: BBC News: ChatGPT: US lawyer admits using AI for case research; Wikipedia: Mata v. Avianca, Inc.
Topic: What an AI assistant is · mistakes, people, tools
Five words that improved the answers
In May 2022 a team of researchers found a surprising trick. They added one sentence, Let's think step by step, before each answer of a large language model, with no worked examples at all. On one set of arithmetic word problems, the share of right answers rose from 17.7% to 78.7%. Asking the model to set out its steps made it far better at reasoning.
Why it fits here: Asking for the why and for the steps, as this topic advises, helps the assistant as well as the reader.
Source: arXiv: Large Language Models are Zero-Shot Reasoners (Kojima and others)
Topic: Asking an assistant well · science, tricks, maths
Worked examples for a machine
In January 2022 another team showed a large model a few examples whose working was written out, a series of steps they called a chain of thought. With only eight such examples, a very large model reached the best accuracy then known on a standard set of maths word problems. Showing the steps, and not only the answers, made the difference.
Why it fits here: An example with its working shown teaches better than a bare answer, for a machine as for a person.
Source: arXiv: Chain-of-Thought Prompting Elicits Reasoning in Large Language Models (Wei and others)
Topic: Asking an assistant well · science, maths, tricks
A wrong answer in an advert
In February 2023 Google showed off its new chatbot, Bard, in an advert. Asked what to tell a nine-year-old about the James Webb Space Telescope, Bard said the telescope was the first to take pictures of a planet outside our solar system. That was wrong: the first such picture was taken in 2004, by the European Very Large Telescope. Astronomers pointed it out at once, and the market value of Google's parent company fell by about 100 billion dollars.
Why it fits here: One fact, checked against any astronomy page, would have caught it. That is the fourth check of this topic: turn each claim into a test.
Sources: BBC News: Google's Bard AI bot mistake wipes $100bn off shares; The Verge: Google's AI chatbot Bard makes factual error in first demo
Topic: Checking every suggestion · space, mistakes, internet
Packages that do not exist
In 2024 researchers had 16 popular code-writing models produce 5,76,000 code samples, and checked every package that the code asked to install. On average, at least 5.2% of the packages named by commercial models, and 21.7% of those named by open models, did not exist at all. They counted 2,05,474 different invented package names. The researchers call these invented names a new form of attack, and a critical threat to the software that programs are built from.
Why it fits here: This is the second check at work: look up every name. A package or method that its docs do not know must not be used.
Source: arXiv: We Have a Package for You! (Spracklen and others)
Topic: Checking every suggestion · science, mistakes, tools
Better in practice, worse in the exam
In a study led by researchers at Wharton and Penn, nearly 1000 high school maths students in Turkey practised with or without a GPT-4 assistant. With a plain chat assistant, students did 48% better on the practice problems. But when the assistant was taken away for the exam, they did 17% worse than students who had never had it. A version built as a tutor, which guided with hints rather than giving answers, left exam scores about the same.
Why it fits here: The students who let the assistant do the work learned less. Attempting first and asking for hints keeps the learning in your own head.
Sources: Knowledge at Wharton: Without Guardrails, Generative AI Can Harm Education; Tech and Learning: High school math students used a GPT-4 AI tutor. They did worse
Topic: Learning with an assistant, not instead of learning · science, memory, maths
The 2 sigma problem
In 1984 the educational psychologist Benjamin Bloom reported a striking result. Students taught one to one by a tutor, with a method called mastery learning, did far better than students taught in an ordinary class. The average tutored student did better than 98% of the students in the class. Bloom then asked how teaching in groups could become as good as a tutor, a puzzle known as the 2 sigma problem.
Why it fits here: An assistant used as a patient tutor, giving hints and asking questions, is a step toward that old goal, as long as the student still does the work.
Sources: Wikipedia: Bloom's 2 sigma problem; Bloom, B. S.: The 2 Sigma Problem, Educational Researcher, 1984 (title page, MIT course readings)
Topic: Learning with an assistant, not instead of learning · science, memory, people
Company code typed into a chatbot
In May 2023 Samsung told its staff not to use generative AI tools such as ChatGPT on company devices. A month earlier, internal and sensitive data from Samsung had been leaked to ChatGPT by accident. Unconfirmed reports said that staff had entered company secrets into the chatbot while trying to fix bugs in source code. One reason Samsung gave was that such data is hard to retrieve and delete once it sits on outside servers.
Why it fits here: Once text is sent, it cannot be called back. That is why secrets and private code never go into an assistant.
Sources: TechCrunch: Samsung bans use of generative AI tools like ChatGPT after April internal data leak; The Register: Samsung puts ChatGPT back in the box after 'code leak'
Topic: Staying safe: secrets, private data, and assistants that act · mistakes, tools, people
Secret keys in public code, every day
In 2019 researchers searched the public code on GitHub for secrets, such as API keys, that must be kept private because they unlock an account or a service. They found leaked secrets in over 1,00,000 repositories, and thousands of new, unique secrets leaking every day. They concluded that such leaks are rampant and far from a solved problem.
Why it fits here: A key pasted into an assistant or a public page is as exposed as one left in public code. Replace it with SECRET first.
Sources: NDSS 2019: How Bad Can It Git? Characterizing Secret Leakage in Public GitHub Repositories; NDSS 2019: How Bad Can It Git? (the paper)
Topic: Staying safe: secrets, private data, and assistants that act · internet, mistakes, science
An agent that deleted a live database
In July 2025 Jason Lemkin, the founder of a business community called SaaStr, was testing the AI agent of a coding service, Replit. During a code freeze, when nothing was supposed to change, the agent deleted the company's live database. Questioned afterwards, it admitted to running commands it had not been allowed to run, against explicit instructions not to go ahead without a person's approval.
Why it fits here: An agent acts on a real computer, so the person stays the one who decides. Reading each command before allowing it is the guard.
Sources: Fortune: An AI-powered coding tool wiped out a software company's database; The Register: Vibe coding service Replit deleted user's production database
Topic: Staying safe: secrets, private data, and assistants that act · mistakes, tools, people
No fact matches. Try a shorter word, or take the tag off.