Skip to content
DevMeme
1015 of 7435
The Existential Crisis of Naming a Variable
CodeQuality Post #1142, on Mar 15, 2020 in TG

The Existential Crisis of Naming a Variable

Description

A four-panel comic strip from 'CommitStrip' illustrating a team of developers descending into chaos over naming a single variable. In the first panel, set in a 'WAR ROOM', suggestions like 'data?' and 'dataDB?' are rejected as 'Too generic' and 'Unclear'. In the second panel, the team dismisses 'listCompleted' ('Already used...') and 'arrayListDataCompleted then!' ('Nah...'). By the third panel, the situation is dire; a developer has passed out, another is huddled in a corner, and they are warned, 'We must choose now or the client might cancel the project...'. A desperate suggestion, 'arrayListCompletedFromForm_withoutDuplicate?', is shot down as 'Too long...'. The final panel is a newspaper, 'THE DAILY CODER', with the headline: 'UNABLE TO NAME A VARIABLE, THEY GO BUST', showing the defeated developers. The comic humorously exaggerates the well-known computer science adage that naming things is one of the hardest problems, highlighting the analysis paralysis that can occur when striving for perfect code clarity and maintainability

Comments

7
Anonymous ★ Top Pick There are only two hard things in computer science: cache invalidation, naming things, and off-by-one errors. The variable `numberOfHardThingsInComputerScience` is still pending a final name
  1. Anonymous ★ Top Pick

    There are only two hard things in computer science: cache invalidation, naming things, and off-by-one errors. The variable `numberOfHardThingsInComputerScience` is still pending a final name

  2. Anonymous

    Implemented Raft to get cluster consensus in 50 ms, but the team spent two sprints deadlocked over whether it’s completedDataList or dataListCompleted - turns out humans are the real Byzantine nodes

  3. Anonymous

    We spent three sprints architecting a distributed event sourcing system with CQRS, but the team imploded trying to name the variable that holds the list of events

  4. Anonymous

    There are only two hard problems in computer science: cache invalidation, naming things, and off-by-one errors. This team proved Phil Karlton right by literally going bankrupt over the first one they encountered. They spent so long debating whether to encode type information in variable names that they never got around to the actual cache invalidation problem - or shipping any code at all. The real tragedy? 'arrayCompletedFromForm_withoutDuplicated' would have been rejected in code review anyway for violating the DRY principle, since the type system already knows it's an array. Sometimes the best variable name is the one that ships

  5. Anonymous

    Naming that list revealed the real problem: we don’t have a ubiquitous language, three teams think “completed” means different things, and the deadline was yesterday

  6. Anonymous

    Classic enterprise fix: two sprints of bikeshedding a local variable, an ADR and linter rule to enforce it, and a monorepo-wide rename that doubled build times - feature still unshipped

  7. Anonymous

    Variable naming's unwritten CAP theorem: pick two from Concise, Accurate, Pronounceable - third's always partitioned into oblivion

Use J and K for navigation