Full Byte Developer.

The real errors behind our programming language stick fight

Each language in the stick fight loses to a real error message. Here is what each one means, with its source.

Published here · 10 sources

In the stick fight video, six languages fight over one question and each one goes down to an error you may have seen in your own terminal. Every error on screen is a real message or behaviour, except one class name I made up, which I point out below. This page says what each one means and links the source.

JavaScript: "1" + 1 is "11"

The + operator does two jobs: numeric addition and string concatenation [1]. If one side is a string, the other side is turned into a string and joined, so "1" + 1 gives "11". That is the block JavaScript throws at Python.

js
"1" + 1 // "11"
1 + 1   // 2

JavaScript: undefined is not a function

JavaScript's charged special fizzles with TypeError: undefined is not a function. MDN lists this family of errors as TypeError: "x" is not a function: you called something that is not a function, often because a name was misspelled or a value was undefined [2]. The exact wording differs between engines.

Python: import antigravity and IndentationError

import antigravity is a real module in CPython's standard library. It opens the xkcd comic about Python in your browser [4]. Python's loss is just as real: IndentationError is the base class for syntax errors caused by wrong indentation [3]. In the video, an extra indent shows up as a floor tile pushed one step to the right, and Python's heel catches it.

Java: the long class name and the GC pause

Java swings a hammer named AbstractFighterStrategyFactoryBean. The name is ours, built after a real Spring class, AbstractSingletonProxyFactoryBean [5]. Then Java freezes in mid-swing: garbage collection can pause the application, and Oracle's tuning guide frames the goal as performing well with pauses of modest frequency and duration [6].

Go: concurrent map writes

go fight() starts a goroutine, so Go splits into four. They all grab the same thing at once and the program dies. The Go 1.6 release notes say the runtime detects concurrent misuse of maps, prints a diagnosis and crashes the program [7]. The message you see is fatal error: concurrent map writes.

Rust and C++: E0502 and the segfault

When C++ grabs Rust's blade, the borrow checker stops it: E0502 means a value already borrowed with one mutability was borrowed again with a different one [8]. C++ then stabs where Rust used to be, which is a dangling pointer in our version, and the process dies with Segmentation fault (core dumped). SIGSEGV is the signal for an invalid memory reference [9].

The giant AI and its context window

The giant is a made-up character, not a product. Its weak spot is a real limit: a model only reads a fixed number of tokens at once. OpenAI's model page lists a context window of 1,047,576 tokens for GPT-4.1, one of its API models [10]. In the video, the languages feed it junk until the meter passes 1M, and it forgets why it was fighting.

If one of these messages shows up in your own terminal, the linked page above is where to start reading.

Send this to the friend who laughed at the stick fight video and wants to know each error.

Keep this guide

By Full Byte Developer

Filed under Dev explainers

Questions about this guide

Why does "1" + 1 give "11" in JavaScript?

Per MDN, the + operator does both numeric addition and string concatenation. When one side is a string, the other side is converted to a string and the two are joined.

What does fatal error: concurrent map writes mean in Go?

Two goroutines wrote the same map at the same time. The Go 1.6 release notes say the runtime detects this concurrent misuse of maps, prints a diagnosis and crashes the program.

Does ChatGPT really have a 1 million token context?

The giant in the video is a made-up character. OpenAI's model page for GPT-4.1, one of its API models, lists a context window of 1,047,576 tokens.

Sources

  1. MDN: Addition (+)developer.mozilla.org
  2. CPython source: Lib/antigravity.pyraw.githubusercontent.com
  3. Rust error index: E0502doc.rust-lang.org

Next in this stack