L6 · EngineeringSoftware Engineering 101 · part 2 of 5

Delta, Foo, and i: The Tiny Names Hiding Inside Your Code

delta, epsilon, i and j, tmp, buf, ctx, foo and bar, nil, 0xDEADBEEF: the short words that appear in variable names rather than in meetings, and what each one actually stands for.

Takumi Yamada
· 16 min read
jargonglossarynamingsoftware-engineeringfundamentalsreadability

Software has two kinds of jargon, and usually only one of them gets explained.

The first is the jargon of meetings: , , bikeshedding, LGTM. I collected those in Software Jargon, Decoded. It's the language teams use to talk about code.

The second kind lives inside the code, and nobody teaches it, because it doesn't look like vocabulary. It looks like variable names.

You open a file and it's full of d, tmp, ctx, acc, lo, hi, dx, dy, buf and foo, and somewhere there's a comparison with 0xDEADBEEF. None of these are keywords of the language, and none appear in its specification. They are shared words that programmers pick up over time without being taught. Until you know them, the code can feel like it's hiding something from you.

It isn't hiding anything. The names are just shortened. Here is what they stand for.

The one that sent me down this hole: delta

Delta means change: the difference between two values. That's the whole idea.

It comes from mathematics, where the Greek capital letter delta, Δ, has meant "the change in" for centuries. ΔT is the change in temperature, and Δx is the change in position. Programmers took the word directly, because "the amount this thing changed" is something you need to say many times a day, and English has no shorter word for it.

Here is where you will meet it.

delta := newTotal - oldTotal       // how much the total moved
scrollDelta := e.deltaY            // how far the wheel turned this tick
timeDelta := now.Sub(lastFrame)    // seconds elapsed since the last frame

It's most common in code about grids and coordinates, where a delta describes a movement.

rowDelta := -1  // the change in the row: move up one
colDelta := +1  // the change in the column: move right one

nextRow := row + rowDelta
nextCol := col + colDelta

rowDelta isn't a mysterious algorithm term. It means "the change in the row". Once you read it that way, a lot of code becomes readable.

// The four cardinal directions, as deltas.
var dirs = [4][2]int{
    {-1, 0}, // up:    row -1, col  0
    {+1, 0}, // down:  row +1, col  0
    {0, -1}, // left:  row  0, col -1
    {0, +1}, // right: row  0, col +1
}

for _, d := range dirs {
    nr, nc := row+d[0], col+d[1]
    if nr < 0 || nr >= rows || nc < 0 || nc >= cols {
        continue // walked off the grid
    }
    visit(nr, nc)
}
-1, 0up+1, 0down0, -1left0, +1rightrow, coleach neighbour showsrow delta, col deltathe dashed cornersare the fourdiagonals
The dirs table drawn on a grid. Each neighbour is the current cell plus one pair of deltas.

That list of four directions is the most common pattern in maze solvers, flood fills (the paint bucket tool), chess move generators, Conway's Game of Life, and the "count the islands" interview question. The eight-direction version just adds the four diagonals.

I think recognizing this pattern at a glance is worth more than memorizing any single algorithm, because the algorithm is usually the less interesting part around it.

The short forms to expect are dx, dy and dz for deltas along the three axes, dr and dc for row and column, and dt for delta time. Delta time is the number of seconds since the last frame. Every game loop multiplies speeds by it, so that things move at the same speed however fast the game draws frames. The d at the start always means the same thing, in git diff, in dx and in dt: difference.

A few related words belong to the same family.

Diff. The difference between two versions of something, usually text. A diff is a delta you can read.

Patch. A diff packaged so that it can be applied to the old version to produce the new one. It's the same information with a different purpose: a diff describes a change, and a patch carries it out.

Increment and decrement. A delta of exactly plus or minus one. That's why the operators are ++ and --.

Offset. Not quite a delta. A delta is a change between two states. An offset is a fixed distance from a starting point, such as " 12 from the start of the file". Both are numbers you add, which is why they get mixed up.

Epsilon. Where delta means any change, epsilon means an amount small enough to ignore. In code, it's almost always about comparing floating-point numbers, the kind with a decimal point. They are stored in , so small rounding errors creep in, and 0.1 + 0.2 == 0.3 is false. So you check whether two numbers are close enough instead.

if math.Abs(a-b) < 1e-9 { // close enough

That 1e-9, which is 0.000000001, is an epsilon, even if nobody gave it the name.

The rest of the Greek that escaped math class

Lambda. A function without a name, written right where it's used. The name comes from Alonzo Church's lambda calculus from the 1930s, the mathematical theory that functional programming grew out of. In Python, the keyword is literally lambda. In most other languages, the idea stayed but the name is only used when people talk about it.

Sigma. A sum. It's rare as a variable name and common in comments and papers. It's also why a running total is often called an accumulator.

Mu and lowercase sigma. The average, called the mean, and the standard deviation, which measures how spread out values are, in anything to do with statistics. In older code you will also see mu meaning microsecond, because the proper symbol μ is hard to type.

Theta, omega and big O. These describe how the cost of an algorithm grows as its input grows. is the upper limit, omega is the lower limit, and theta is both at once. In practice, people say "big O" and mean theta.

input size ncostO(1)flatO(log n)barely growsO(n)linearO(n²)fine at a hundred items,too slow at a million
Four common growth rates. Big O names the shape of the curve.

Pi, tau, phi. Pi and tau are the circle constants, where tau is 2π. Phi sometimes means the golden ratio, in code for layout and for hashing.

Nabla, also called del. The gradient, in machine learning code and papers. It says which way and how steeply a value changes. When a variable is named grad, this is what it means.

Loop and index words

i, j, k. Loop counters, used in that order when loops are inside each other. This habit is very old. It comes from FORTRAN, where variables whose names started with the letters I to N were whole numbers by default, and before that from mathematics, where i, j and k were used as subscripts. Single letters are fine here, because the variable only lives for a few lines. The same name used across a whole file would be a bad choice.

n. The number of things. You have n items, you loop up to n, and the work takes O(n) time. When there are two collections, m is the second count.

idx, pos, at. An index, the position of an item in a sequence. That's different from id, which identifies a thing wherever it is.

lo, hi, mid. The three variables of binary search, which finds an item in a sorted list by checking the middle and throwing away the half it can't be in. They appear in every algorithm built the same way.

prev, cur, next. The previous, current and next item, for anything you walk through one item at a time: linked lists, iterators and streams of events. You will see both cur and curr, and both are fine.

head, tail. The first item and the rest. In a linked list, they are the first node and everything after it. For a log file, they are the top and the bottom. In , HEAD is the you are currently on.

BINARY SEARCHlomidhiWALKING THROUGHprevcurnextA LISTheadtail
Where each of those names sits in a sequence.

src, dst. Source and destination, the two arguments of every copy function. Which one comes first changes between languages, and that causes bugs all the time. C's memcpy takes the destination first, while the shell command cp takes the source first.

acc. Accumulator, the running result while you combine a list of values into one.

swap, tmp. The usual way to exchange two values: copy one into a temporary variable, then move the values across. You still see it in languages that can't swap two variables in one line.

The abbreviation dialect

Most short names are English words with letters removed. The list is short enough to learn in one sitting.

ShortLongNotes
tmp, temptemporaryValue with a lifespan of a few lines
bufbufferA chunk of memory you read into or write out of
len, caplength, capacityHow much is in it, versus how much fits
ptr, ref, referenceSee the asterisk posts
ctxcontextRequest scoped state, deadlines, cancellation
cfg, confconfigurationSettings, usually parsed from a file or the environment
envenvironmentBoth prod versus staging, and environment variables
arg, argv, argcargument, argument vector, argument countC's main gave us the last two
req, res, resprequest, responseThe two halves of every handler
err, errnoerror, error numberif err != nil is most of Go
val, varvalue, variable
str, num, arr, objstring, number, , object
initinitializeSetup that runs once, before anything else
implimplementationThe concrete thing behind an interface
util, misc, helpersutility, miscellaneousWhere code goes when nobody names its concept
auxauxiliaryA secondary, supporting thing
svcservice
repoEither a Git repo or the data access layer, context decides
dtodata transfer objectA plain with no logic that exists to cross a boundary
fn, cb, handlerfunction, callbackA function passed to other code to be called later
mut, mutexmutual exclusion lockGuards shared state between
semsemaphoreA counter-based lock that allows N holders
regex, reregular expression
stdin, stdout, stderrstandard input, output, errorThe three streams every starts with
fdfile descriptorThe small integer the OS hands you for an open file
pid, tid, uid, gidprocess, thread, user, group ID
i18n, l10n, a11y, k8sinternationalization, localization, accessibility, kubernetesNumeronyms

The last row is a useful trick to recognize. i18n isn't a product name. It's the letter i, then 18 letters left out, then the letter n. "Internationalization" is long to type, so the short form spread, and it's now part of the names of whole libraries. Words shortened this way are called numeronyms.

internationalization18 lettersi + 18 + n = i18n
How i18n is built. l10n, a11y and k8s follow the same rule.

Names that mean "nothing goes here"

foo, bar, baz, qux. Placeholder names, used when an example needs a name and the name doesn't matter. Their proper name is metasyntactic variables.

foo and bar probably come from military slang of the Second World War. They were used at MIT by the early 1960s, and RFC (Request for Comments) 3092 describes them, in a deliberately serious style. Python's documentation uses spam and eggs instead, from the comedy group Monty Python, which also gave Python its name. When you see foo, it tells you one thing: the name doesn't matter here.

Alice and Bob. The two people in almost every explanation of cryptography and network . They are joined by Carol, Dave, Eve, who eavesdrops, and Mallory, an attacker whose name comes from "malicious". If you read How a VPN Actually Works, you have met them already.

Lorem ipsum. Scrambled Latin, originally from the Roman writer Cicero. Designers use it as filler text, so they can judge a layout without reading the words.

A round photo of the marble bust of Cicero, with his name below.
A bust of Cicero, the Roman writer and statesman, in the Capitoline Museums in Rome. Lorem ipsum comes from his book On the Ends of Good and Evil, from 45 BC, with words cut and changed.Photo: Wilfredo Rafael Rodriguez Hernandez, CC0 1.0, via Wikimedia Commons (original). Changes: cropped to a circle and placed on a card with the name.

example.com and 192.0.2.1. A and an address set aside by standards bodies for examples, so that documentation can never point at someone's real by accident.

Names that mean "there is genuinely nothing here"

This group causes more confusion than any other, because about six words mean almost the same thing.

null. No reference: a pointer that points nowhere. Tony Hoare, who invented it, later called it his "billion-dollar mistake", because every language that has null also has the crash you get from using it.

A round portrait of Tony Hoare, with his name below.
Tony Hoare in 2006. He added null references to the language ALGOL W in 1965, and in 2009 called them his billion-dollar mistake. He also invented Quicksort, one of the most widely used sorting algorithms.Photo: Dennis Hamilton, CC BY 2.0, via Wikimedia Commons (original). Changes: cropped to a circle and placed on a card with the name.

nil. The same idea, as Lisp, Go and Ruby spell it. In Go, it's also the zero value of pointers, maps, , channels and interfaces. That's why if err != nil means "if there is an error at all".

None. Python's version. It's a real object, the only one of its kind, not a special missing value.

undefined. JavaScript's second kind of nothing, and the difference matters. null means "deliberately set to nothing", and undefined means "never set at all". Most other languages manage with only one of these.

NaN. Short for "not a number". It's the floating-point result of a calculation with no meaning, such as zero divided by zero. It's famous for one property: NaN isn't equal to itself. So the only reliable way to check for it is a special function made for that.

void. Not a value at all. It means a function returns nothing.

Zero value, or default. What a variable holds before you set it. Go guarantees a known value. C doesn't, which is why a variable you forgot to set in C holds whatever was in that memory before.

Sentinel. A real value chosen to mean "no value", because the type has no other way to say it. -1 for "not found", 0 for "no time limit", EOF for "end of file". A sentinel works until a real -1 turns up in the data.

Empty versus missing. An empty list exists and has nothing in it. A missing list doesn't exist at all. Mixing the two up is how "0 results" turns into "500 Internal Server Error".

EMPTYitemsa referenceA LISTlength 0the list exists, with nothing in itMISSINGitemsnilNO LISTthere is no list at all
Empty and missing, side by side.

Magic numbers, and the famous ones

Magic number. A number written in the code with no explanation of what it means. if (status == 3) uses a magic number. if status == StatusRefunded doesn't. The fix is always the same: give the number a name.

The term has a second, unrelated meaning: the bytes at the start of a file that identify its format. A zip file starts with PK, and a PDF starts with %PDF. That's how the file command knows what a file is without trusting its name.

ITS FIRST FOUR BYTES, IN HEXADECIMALa zip file504B030450 4B is the letters PKa PDF25504446the characters %PDFa Java classCAFEBABEreads as CAFE BABE
The second meaning of magic number: the bytes at the start of a file that say what kind it is.

0xDEADBEEF and 0xCAFEBABE. Numbers in that spell English words, using only the letters A to F. Debuggers and memory tools fill freed or unset memory with values like these. If a program then reads that memory by mistake, it gets an obviously fake value that's easy to recognize, instead of data that looks real. 0xCAFEBABE is also the magic number at the start of every compiled Java class file.

42. The answer to everything, from the book The Hitchhiker's Guide to the Galaxy. In a test, it almost always means that any number would have done.

Off by one, or fencepost error. The bug where a loop runs one time too many or one time too few. It's named after a puzzle: a 100-metre fence with a post every 10 metres needs 11 posts, not 10.

post10 m210 m320 m430 m540 m650 m760 m870 m980 m1090 m11100 mten gaps of 10 metres, eleven posts
The fence from the puzzle: ten gaps, eleven posts.

The cause is almost always the edge of a range: whether the last number is included or not. Most languages count from zero, and a range from 0 to n includes 0 but not n. That's why the usual loop is written with "less than", not "less than or equal to".

The words in comments

Some words in comments work like a small shared code, and most editors highlight them.

TODO marks work that is known to be missing. FIXME marks code that is known to be broken. HACK, sometimes KLUDGE, means "this works, it's ugly, and I knew it". XXX means "danger, look here". NOTE gives background you would otherwise have to work out yourself. WIP means work in progress, not ready for review. NB is short for the Latin nota bene, "note well".

The important thing about all of these: a TODO with no name and no ticket number usually never gets done. The ones that get done are the ones linked to a ticket.

Saying symbols out loud

Nobody writes this down, and then one day you are on a call, trying to read a regular expression out loud.

! is bang, or not. * is star, splat, asterisk, or glob. & is ampersand, and, or address of. | is pipe. ^ is caret, hat, or xor. ~ is tilde or twiddle. # is hash, pound, sharp, or octothorpe. ` is backtick. _ is underscore. / is slash and \ is backslash, because the slash leans forward as you read. {} are curly braces, [] are square brackets, () are parens, and <> are angle brackets. -> is an arrow and => is a fat arrow. :: is a double colon or the scope operator. ?. is optional chaining and ?? is nullish coalescing. << and >> are shift left and right, or in a shell, redirects. $ is dollar, and at a shell prompt it's the part you don't copy.

The ways of writing names that join several words have names too, and they matter in code review: camelCase, PascalCase, snake_case, SCREAMING_SNAKE_CASE for constants and environment variables, kebab-case for , CSS and command-line flags, and dot.case.

userAccountIdcamelCasevariables in JavaScript, Java and GoUserAccountIdPascalCasetypes and classesuser_account_idsnake_casenames in Python and RustUSER_ACCOUNT_IDSCREAMING_SNAKE_CASEconstants, environment variablesuser-account-idkebab-caseURLs, CSS, command-line flagsuser.account.iddot.caseconfiguration keys
One name in each casing convention, and where you usually see it.

There is also Hungarian notation, which puts the type into the name, as in strName and iCount. It's rarely used today, because and editors show you the type anyway.

Sigils are symbols at the start of a name that say what kind of thing it is: $var in PHP and shell scripts, @ivar in Ruby, %hash and @array in Perl. An underscore at the start of a name usually means "private, don't touch", and a name that's only an underscore means "I have to name this, but I'm ignoring it".

Naming conventions that carry meaning

The beginnings and endings of names are jargon too. I think of each one as a promise to the reader.

is, has, can, should start the name of a true-or-false value, as in isActive and hasPermission. If something starts with is and returns text, someone will report it as a bug.

get, fetch, load, compute don't mean the same thing in good code. get should be quick and need nothing outside the program. fetch suggests the network. load suggests the disk or something else slow. compute suggests real work. The first word tells the reader how expensive the call is.

getUser()MEMORYcheap and localfetchUser()THE NETWORKa round trip, and it can failloadUser()THE DISKor another slow resourcecomputeTotal()THE CPUreal work
The verb in a name tells the reader how expensive the call is.

new, make, create, build create things, roughly in order of how much setup they do. newX returns an X. makeX often sets up what's inside it. buildX usually finishes a series of setup steps.

to, from, as, parse, format convert things. parse turns text into structured data, and it can fail. format turns structured data into text, and usually can't fail. as suggests a cheap change in how the same data is viewed, while to suggests a real conversion.

on and handle mark code that responds to an event, as in onClick and handleSubmit.

Plurals mean collections. A user is one, and users is many. That seems obvious until someone names a list userList, and now one file has two styles.

_test, .spec, .mock in a file name mark the test files that belong with the code.

Why any of this is compressed at all

It's fair to ask why programmers, who agree that code is read more often than it's written, shorten so many names.

I think the answer is that these short forms aren't really abbreviations any more. They are words of their own.

ctx isn't a shortened "context" the way "gov't" is a shortened "government". It's a word with its own exact meaning: the bundle that travels with a request, holding its deadline, its cancel signal and its trace ID. That's far more specific than the English word "context". err, buf and dst work the same way. The names got shorter, but their meanings also got sharper.

That leads to the real rule for when a short name is fine, and it's the rule under everything in this post. The longer a name is used, the longer it should be.

A loop counter that lives for three lines can be i, because you can see everything about it at once. A variable that lives for the whole program needs a name that still makes sense when you read it on its own, in an error message, at three in the morning. Brian Kernighan and Rob Pike put it well: the further a name is used from where it was declared, the more it needs to describe.

Round portraits of two men, with their names below: Brian Kernighan and Rob Pike.
Brian Kernighan and Rob Pike. They wrote The Practice of Programming together in 1999, the book this advice about names comes from. Kernighan also wrote The C Programming Language with Dennis Ritchie.Left photo: Ben Lowe, CC BY 2.0, via Wikimedia Commons (original). Changes: cropped to a circle and placed on a card with the name.Right photo: Kevin Shockey, CC BY 2.0, via Wikimedia Commons (original). Changes: cropped to a circle and placed on a card with the name.

So rowDelta is a good name for both reasons. It's short enough to write forty times in a grid algorithm, and it says exactly what it is: the change in the row. That's all delta ever meant. Most of the other short names are just as easy to read once you know what they stand for.

For the words teams use about code rather than inside it, the companion post is Software Jargon, Decoded. For the most argued-about symbol in the list above, The Two Jobs of the Asterisk and List* l or List *l? go into full detail.

Check yourself

3 questions · nothing is saved
  1. 1.What does the d at the start of dx, dt and git diff stand for?
  2. 2.What is i18n?
  3. 3.What makes NaN unusual among values?

Who wrote this

Author profile and background

Takumi Yamada

Takumi Yamada

· Backend Engineer

Backend engineer building services, databases, Linux tooling, and NEGEN SYSTEMS. Writing about low-level mechanics, distributed systems, and real-world security.

End of post
NEGEN SYSTEMS
Receipt · post 27 of 31
Written
Aug 1, 2026
Length
3,623 words · 16 min
Built
…
Served by
…
Delivered
…
Over the wire
…
Go's share
…
Next in Software Engineering 101 · part 3 of 5

Project Zero: How Real Teams Start Codebases

What happens before the first line of code, after `mkdir` and `main.go`. How a team sets up, plans and tracks a new application.

5 min read
From other series