When British English Meets the C Preprocessor
Why is this Languages meme funny?
Level 1: Silly Spelling Swap
Imagine you and your friend have a special rulebook for a game. In this rulebook, the word "jump" is used everywhere to describe a certain move. Now, suppose your friend is from a place where they prefer to say "leap" instead of "jump." Instead of just remembering to say "jump" like everyone else, your friend goes through the rulebook and puts a sticky note over every "jump" with the word "leap" on it. So when they read the rules, it looks like the game uses their favorite word "leap." But of course, the game itself hasn't changed at all — it's the same move, just a different word on top.
If someone else opens this rulebook and sees "leap" everywhere, they'd be confused: "Wait, I thought the move was called 'jump' in this game?" Your friend would then have to explain, "Oh, yeah, it is officially 'jump'. I just personally like calling it 'leap', so I covered it up in my copy of the rules." You might laugh at how unnecessary and extra that is, right?
That's basically what's happening in this coding joke. The programmer liked the British way of spelling and saying things (using "whilst" instead of "while", "colour" instead of "color"), so they set up a little trick in their code to swap those words automatically. It didn't change what the computer was doing at all — it just changed how the code looked to a human. It’s as if they put sticky notes over the code's words to suit their taste. When other programmers see that, their first reaction is confusion ("Did I open some alternate-universe version of C?"), and then, when they realize what's going on, they usually start laughing. It's a harmless, playful tweak that makes the code look quirky. We find it funny because it's like someone insistently using their own slang or spelling in a situation where everyone else sticks to a standard way — a little bit stubborn, a little bit creative, and definitely a bit silly.
Level 2: Macro Shenanigans
Let's break down what's happening in this meme in simpler terms. It involves the C programming language (one of the popular CFamilyLanguages like C++ as well) and something called the "preprocessor." In C/C++, the preprocessor runs before the actual compilation of code. One of its features is the #define directive, which basically tells the compiler, "Hey, whenever you see X in the code, replace it with Y before you compile." It's like an automatic find-and-replace for your source code. These are what we call preprocessor_macros.
In normal C/C++ code, the keyword to start a loop is while. For example:
while (condition) {
// repeat this block as long as condition is true
}
The word while is a reserved keyword in the language, meaning it has a special predefined purpose (starting a loop, in this case).
The meme is talking about a programmer (apparently a British one) who wrote a macro in a global header file that does something unusual:
#define whilst while
A global header file is a header (a file usually ending in .h) that's included in many or all source files of a project. Including a header literally pastes the contents of that header into each file that includes it, before compilation. So if you put #define whilst while in such a header, every file in the project will effectively get that line at the top during the preprocessing step.
This macro tells the preprocessor: whenever you encounter the token whilst in the code, replace it with while before handing it off to the compiler.
Now, in everyday British English, "whilst" means the same thing as "while" (it's just a slightly more old-fashioned or formal British way of saying it). But in C code, whilst by itself has no meaning — it's not a keyword that the language recognizes. Normally, if you wrote:
whilst (x < 5) { … }
the compiler would throw an error like "unknown identifier 'whilst'" or "expected ‘(’ after 'while'" because it doesn't know what whilst is.
However, with the macro #define whilst while in place, something magical (or rather, sneaky) happens: the compiler never actually sees whilst. The preprocessor sees it first and transforms it. So the code that the compiler proper gets to see has while (x < 5) { … }. In other words, the developer made it so they could write whilst in their source code, but it would behave exactly as if they wrote while. They essentially tricked the compiler by teaching it a new word via find-and-replace.
The second part of the meme shows another user chiming in with:
#define colour color
This is a similar deal. In code (and in many APIs), the word "color" is used (American spelling). But British spelling is "colour" with an extra 'u'. So imagine a graphics library where you have a function like setColor(red) to set a color. A British dev might instinctively type setColour(red) and get an error. With a macro #define colour color, they could write colour in code and the preprocessor would swap it to color so it matches the actual function name. Again, it's like adding British spelling as an alias for the American-spelled identifiers.
So what's the big deal? Why do people find this funny or see it as Macro Shenanigans? A few reasons:
- It's purely cosmetic. The macro doesn't add any new functionality or fix a bug; it's just swapping out words to satisfy someone's personal preference for spelling. It’s like putting a Brit dialect filter on your code. Technically effective, but kind of extra.
- It can be confusing. If you didn't know about these macros and you saw
whilstin a C program, you might scratch your head or think you've forgotten the language syntax. It's not immediately obvious that a macro is doing this behind the scenes. It breaks the normal expectations. Code is kind of like a language, and here someone introduced a new word that isn't in the standard "dictionary" of that language. Until you find the macro definition, you're in the dark. - Global impact with no isolation. Because it was in a global header, this macro affects everywhere in the program. If somewhere else in the code the word
whilstappeared (maybe as part of another name or comment), the preprocessor would try to swap it. For example, if you had a variable namedwhilstCount(kind of contrived, but bear with me), the preprocessor might see the tokenwhilstin there and turn it intowhile. In practice, it only replaces whole tokens, sowhilstCountwouldn't match exactly, but if there was something likewhilstas a standalone or->whilstas a struct member, it could wreak havoc. The macro doesn't know context; it just replaces exact token matches. - Maintenance headache. Imagine coming back to this code a year later (or handing it off to another team). The new person sees
whilstand might start searching in Google like "C whilst loop syntax", coming up empty. It's a gotcha that makes the code harder to maintain. Generally, a coding mistake or bad practice is something that makes code harder for others (or yourself later) to work with. This definitely qualifies, even if it's done in jest. - Why not just stick to the standard? There's an underlying question: if everyone is used to
whileandcolorin code, what was so hard about using those? The humorous answer is "Nothing, it was purely done for fun or personal satisfaction." It's a bit of an unnecessary hack, which is why it's amusing. It's like using a huge machine to crack a peanut — overkill, but in a funny way.
To illustrate, consider a small snippet with and without the macro:
Without macro (normal C code):
int i = 0;
while (i < 3) {
printf("%d\n", i);
i++;
}
With the fancy British macro (#define whilst while in effect):
int i = 0;
whilst (i < 3) {
printf("%d\n", i);
i++;
}
If you compile the second snippet with that macro defined, it works exactly the same as the first. The loop prints 0, 1, 2. The only difference is in the source code you wrote "whilst" instead of "while". The macro took care of translating it during compilation.
Now, the meme’s text itself is from a comment thread. The original poster says they remember a weird British developer who did this #define whilst while in a global header. People reacted to that because it's both bizarre and kinda funny. One person jokes by adding #define colour color (showing, "ha, they even alias variable names to British spelling!"). Another expresses surprise and delight at the idea of whilst loops, calling it one of the greatest things they've seen — obviously exaggerating for comedic effect.
The tone here is light; nobody is truly advocating for everyone to start doing this. It's more like a "Can you believe someone actually did that? Hah!" shared among programmers. It highlights a combination of CodingHumor (silly hacks we find funny) and a gentle cautionary tale (maybe don't try this at home, kids).
So, if you're new to programming, the key takeaways are:
#define X Yreplaces X with Y in code. It's powerful but should be used responsibly.- Using
#defineto alias keywords or standard names (like turningwhileintowhilst) is not a normal or recommended practice. It's done here for a laugh. - Part of the humor comes from the cultural twist (British vs American usage) and part from the sheer audacity of meddling with the code in this way.
- This is a bit like a prank or inside joke in code form. It works (the code runs), but it's doing something unnecessary and potentially confusing, which is exactly why it's meme-worthy.
Think of it this way: the programmer basically said, "I know the proper way to do it, but I'm doing this funky thing anyway, just because I can." That attitude often yields entertaining results in hindsight, which is what we’re chuckling about here.
Level 3: Global Header Horrors
In the eyes of an experienced developer, this meme showcases a blend of humor and horror from the trenches of coding. It’s poking fun at a real CodeQuality nightmare: using a macro to effectively change the language’s keywords. Senior engineers have strong opinions about this sort of thing, because they've seen how it ends.
Here, a developer decided to inject British flair into C code by adding #define whilst while (and even #define colour color) in a globally included header. On the surface, it's a cheeky nod to British English — writing code with whilst loops and colour variables. It gets a chuckle because programming languages typically stick to one dialect (usually American English for keywords and standard libraries). Seeing British spellings in code is unexpected. But under the hood, it's a BadPractice that sets off alarm bells. Abusing preprocessor_macros for such linguistic tweaks is widely frowned upon; these directives were never meant to redefine the language's keywords or standard library names.
Why do seasoned devs find this funny? Because it's absurdly unnecessary and risky — a textbook AntiPattern. Imagine reviewing code and stumbling upon:
whilst (condition) { … }
If you're not in on the joke, you'd probably double-take and think, "Is this a new loop construct I never heard of?" It’s like finding a secret word in a place it doesn’t belong. Once you realize there's a #define whilst while hiding in a header file, you get that mix of amusement and dread: They really did that!
Many of us have war stories about macro misuse. Macros in C/C++ are powerful but notoriously tricky; when overused, they can make code unpredictable and hard to debug. Putting something like #define whilst while in a common header means every source file that includes it now has this rule active. It’s essentially one of those infamous global_header_hacks that affects the entire project silently. It's like someone secretly replaced all your coffee with decaf — you might not notice at first, but you’ll definitely feel that something’s off when you need the jolt. If any code anywhere uses the word whilst (even accidentally as a variable name, say), that macro will hijack it. Debugging such issues can be a nightmare because the cause (the macro) is far removed from the effect (weird error or behavior). Experienced devs have learned to be very cautious with global macros; they’re the kind of trick that might save a minute now but cost hours later.
Consider maintenance: a few months later, a new developer (maybe from outside the UK) joins the project and sees a whilst in the code. Their reaction is likely, "Typo? Did they mean while?" They might waste time searching for this phantom keyword or question their understanding of C. Eventually, they'll discover the #define in the header and probably facepalm. It's the kind of surprise that makes code harder to read and maintain. Readability is a big deal in software engineering—code is read many more times than it's written. Introducing a non-standard keyword (even via trickery) violates the principle of least astonishment: the idea that code should behave (or appear) in a way that least surprises other developers. Here, the surprise is the joke, but in a production codebase it would be a groan-worthy discovery.
This scenario also touches on team conventions and code reviews. In a professional setting, if someone submitted a change adding #define whilst while to a common header, the review comments would range from "Why?" to "Please remove this." It's clever in a mischievous way, but it breaks consistency. In shared code, everyone agrees to speak the same "language." One person writing in a personal dialect forces everyone else to adapt or decode it. It’s almost like a developer deciding to code all their comments in Shakespearean English or using variable names in French – quirky, not catastrophic, but definitely not team-friendly. The humor here is that this real (or hypothetical) British developer either didn’t care or thought it was funny enough to justify the confusion. It’s a reminder of the human side of coding: we have inside jokes and personal quirks, but we usually keep them out of the actual code... usually.
The British vs American spelling angle gives the meme an extra cultural chuckle. Everyone in programming learns quickly that you stick to the programming language’s vocabulary. For instance, in CSS you must use color: red; not colour: red; or it won't work. In C, you write while, not whilst. A British programmer might internally think "colour" or say "whilst" in conversation, but they code with the American terms because that’s the standard. Here someone said, "Nah, I’ll make the computer speak my language." It's endearing in a way — like a form of programmer patriotism or linguistic pride — but also objectively silly. It reminds experienced devs of other times people have tried to force a personal preference in code. The DeveloperHumor aspect comes from that relatability: we've all encountered code that made us laugh or roll our eyes because the author did something idiosyncratic.
For a concrete example of why this is problematic, think about error messages or debugging. Suppose there's a syntax error in a file that uses whilst. The compiler might report an error involving while (since that's what it saw after macro expansion) on some line number. A developer reading the error output would go to that line and see whilst in their editor, not while, potentially causing a moment of confusion: "The error says 'while', but I don't have 'while' on this line..." Similarly, tools that do static analysis or code indexing might not resolve the macro and could flag whilst as an unknown symbol. It’s these little friction points that make veterans groan. They know that clever tricks in code often become tomorrow’s headache during debugging at 3 AM (when, as the cynical saying goes, everything is ALWAYS a DNS issue or in this case, a macro issue).
Also, macros don't obey namespaces or scope. If tomorrow someone includes a new library and that library happens to have its own identifier named whilst or colour, you have a collision. The library code could break in weird ways because our British macro will tamper with it. This kind of thing has happened in real life: for example, Windows system headers famously do #define min(a,b) ... and #define max(a,b) ... as macros, causing conflicts if you try to use std::min in C++ or have variables named min. It's messy. The whilst macro is the same kind of messy, just with a more humorous twist. It’s the sort of thing that a linters or code analysis tools would flag as a problem (if they even anticipate someone doing this).
Despite all these serious considerations, the reason this is a meme and not just an angry rant is because it's done in a spirit of fun. The Reddit-style thread shows people riffing on it, adding #define colour color and expressing astonishment. There's a tongue-in-cheek admiration: "He was using whilst loops? That's one of the greatest things I've ever seen." Of course, they don't literally think it's a great idea for production code — they mean it's hilariously bold. It’s like seeing a "creative" solution that makes you laugh and think, "I'll never do that, but thank you for the entertainment."
In summary, the seasoned developer perspective on this meme is: we're laughing because it's so wrong. It highlights a known CodingMistakes scenario in a lighthearted way. We've dissected enough gnarly legacy code to know that just because you can do something in C doesn't mean you should. This meme is a gentle reminder wrapped in humor. The next time someone feels the urge to do something fancy with macros, maybe they'll remember the tale of the whilst loop and think twice!
Level 4: Lexical Hijacking at Compile Time
At the deepest technical level, this meme highlights CompilerDesign quirks in C/C++ and how the preprocessor phase can be exploited. In C-family languages, the compilation process has a distinct preprocessing stage before actual code parsing. The #define directive is a classic C preprocessor macro mechanism: it performs a token-level substitution on the source code before the compiler's main pass.
Here, the British developer wrote #define whilst while in a global header file. This means that anywhere in the code after including that header, the token whilst is automatically replaced by while by the preprocessor. Essentially, they've invented a new "keyword" (whilst) as a mere alias for the real loop keyword while. It's a form of language_keyword_aliasing done outside the language's grammar rules.
Under the hood, this exploits the two-phase nature of C compilation:
- Preprocessing Phase: The source is scanned for macro definitions and expansions.
whilstis not a reserved word, so the preprocessor is perfectly happy to use it as a macro name. Whenever it encounterswhilstas a separate token, it substitutes it with the token sequencewhile. This is a purely lexical operation with no understanding of C syntax. - Parsing/Compilation Phase: After macro expansion, the resulting code (with all
whilstturned intowhile) is fed to the compiler's parser. The parser now sees only standard C code. It has no clue thatwhilstever existed in the source.
From a formal standpoint, the developer managed to inject a new terminal symbol into the language via macros. It's like customizing the compiler's lexical output without modifying the compiler itself. The humor (and horror) lies in the idea that one can impose their British spelling and style preferences by essentially tricking the compiler. BadPractices aside, it's a clever hack: the compiler treats whilst as just another identifier (like a variable name) until the preprocessor swaps it out for the while loop keyword it actually recognizes.
This is analogous to writing a mini translation layer. Think about how a compiler's lexer works: it normally identifies while as a specific keyword token that leads into a loop in the abstract syntax tree. Here, the preprocessor intercepts the unrecognized token whilst and transliterates it into while. It's a bit like teaching the compiler a new synonym at compile time, without altering the compiler's code. This leverages the fact that the grammar for C is not aware of whilst at all; but by the time the grammar is applied, all those whilst occurrences have been converted.
However, macros being purely textual (or token-based) substitutions come with many hazards. They don't respect scope or context. A #define placed in a global header file is especially dangerous because it's essentially a global_header_hack — it affects every source file that includes that header, project-wide. If some other code had an identifier named whilst (for example, a function or variable legitimately named whilst), this global macro would silently replace that too, potentially causing compile errors or logic changes. This unintended capture of tokens is why macro abuse is notorious. It's nearly like performing search-and-replace on your codebase with no regard for grammar context (though the preprocessor at least operates on token boundaries).
From a formal language perspective, the developer basically created a tiny DSL (Domain Specific Language) or dialect on top of C. The macro effectively treats "whilst" as if it were part of the language's vocabulary. It's reminiscent of how early compilers or language preprocessors were designed. In fact, one can draw parallels to how lexers and parsers are implemented: the lexer classifies sequences of characters into tokens (like 'while' as a keyword token). The macro preprocessor, running prior, intercepts certain identifier tokens and morphs them into others. It's like an overlay on the lexical analysis phase — a cheeky form of lexical hijacking. It's not exactly how the language was intended to be used, but it's possible because the C preprocessor was designed as a simple textual substitution mechanism, originally for including headers and constants, not for altering fundamental language constructs.
This approach also reflects on language design choices. Modern languages often avoid having such a powerful preprocessor because it can undermine the language's own syntax rules. C inherited the preprocessor from its ancestors (the CPP dates back to the 1970s) to handle things like include files and simple macros, giving developers a very sharp tool. You can modify code textually in arbitrary ways, yielding immense flexibility (like conditional compilation, generating repetitive code, etc.), but also the power to shoot yourself in the foot. In this macro trick, our British developer used that freedom to "internationalize" the language's keywords. It's a kind of meta-programming at the lexical level, albeit done in a hacky way.
Interestingly, reserved keywords in C can't be redefined as macros directly because you can't write #define while somethingElse — the preprocessor would reject using while as a macro name (since it's a reserved word). However, the creativity here is using an unused word ("whilst") as the macro name to alias the real keyword. This is a subtle but important detail: the macro name must not be a reserved word, but it can expand to reserved syntax just fine. So whilst is free to use as a macro identifier, and expanding to while is fair game. To the preprocessor, while in the replacement text is just characters to output; it doesn't treat it specially. The parser later gives meaning to that while token.
This "two-phase" compilation is exactly why things like this macro hack can exist. It's exploiting the separation of concerns: first do textual substitution, then interpret the language. It's akin to breaking the fourth wall of language syntax. From an academic viewpoint, one might say this trick blurs the neat division of the compilation process. The set of programs accepted by the compiler is effectively larger with the macro than without — suddenly whilst (...) { ... } is a valid preprocessed program even though whilst isn't in the language grammar. In formal terms, the combination of preprocessor + compiler makes the language context-sensitive in practice: whether a token sequence is valid can depend on macro context, not just the fixed grammar. It’s a reminder that C’s "language" isn't purely defined by its BNF syntax; it’s partly defined by what the preprocessor lets through or transforms.
For example, consider this code using the macro:
#define whilst while
int main() {
int i = 0;
whilst (i < 5) {
printf("%d\n", i);
i++;
}
return 0;
}
On first glance, it looks like it uses a non-existent loop keyword whilst. But after the preprocessor runs, the compiler actually sees:
int main() {
int i = 0;
while (i < 5) {
printf("%d\n", i);
i++;
}
return 0;
}
The loop works perfectly normally. The source code had a disguise that gets peeled away before the real work is done.
One might compare this practice to software internationalization (i18n), but applied at the wrong layer. Usually, i18n means adapting user-facing text to different languages. Here, the developer is adapting the programming language itself to a different dialect of English using the preprocessor. It's as if they felt the language should be more "Queen's English" compliant. While creative, it's definitely not standard practice in any coding style guide.
In fact, this level of macro trickery is reminiscent of the kind of code you might see in the International Obfuscated C Code Contest (IOCCC). Contest entries often use bizarre macros to create misleading syntax or hidden behavior. They might, for example, #define begin { and #define end } to make C code read like another language, or redefine common words just to confuse readers. Similarly, our #define whilst while is a benign example of obfuscation: it makes the code read like pseudo-English ("whilst (condition) do ...") but anyone who knows C would double-take: "Wait, 'whilst' isn't a keyword... oh, there's a macro trick!"
So at Level 4, the meme’s humor comes from a deep appreciation of how this code is bending the rules of the language. It exploits the separation between the preprocessor and the compiler in a sneaky way. It's funny because it's academically absurd — using serious low-level compiler mechanisms to satisfy a programmer’s personal linguistic preference. In other words, it's preprocessor creativity gone wrong: a whimsical hack that operates on the compiler’s innards, prompting us to marvel at the cleverness while simultaneously cringing at the abuse of such power.
Description
A screenshot of a conversation on a social media platform, likely Reddit, with a dark mode theme. The original post describes a 'weird British developer' who put '#define whilst while' in their global header file. Below this, a comment adds '#define colour color', reinforcing the British English theme. A third comment expresses amusement, saying, 'He was using whilst loops? That's one of the greatest things I've ever seen'. The humor comes from abusing the C preprocessor for stylistic and regional language preferences, a practice that is technically possible but universally considered poor form as it makes code confusing and non-standard. For experienced developers, especially those who have worked with C/C++, this is a classic example of 'clever' code that creates a maintenance nightmare, humorously highlighting the tension between coding standards and personal quirks
Comments
7Comment deleted
That developer probably has a CI pipeline that fails if you don't end your commit messages with 'Cheers'
The London office slipped “#define whilst while” into the shared header - instant compile-time localisation, linter mutiny, and a guarantee every grep-based refactor misses at least one loop
Wait until you see his pull request that got rejected: #define lift elevator in the IoT firmware that controls the building's infrastructure
Ah yes, the classic British developer move: using preprocessor macros to enforce the Queen's English in C code. While most of us debate tabs vs spaces, this legend was out here making 'whilst' loops a reality. It's the perfect blend of linguistic pedantry and technical debt - because nothing says 'maintainable codebase' quite like forcing every new developer to mentally translate your Victorian-era control flow. Next up: #define lorry truck and #define boot trunk for that automotive systems project. The real genius? Every code review becomes a grammar lesson, and your CI/CD pipeline now requires a dictionary
If your i18n strategy is '#define whilst while' in a global header, you've created a scope-less language fork; enjoy the day clang-tidy insists the codebase now targets British C
Global #define whilst while is internationalization via the preprocessor - until ‘int whilst = 0’ expands to ‘int while = 0’ and the compiler complains that your variable is a control statement
Global macros redefining keywords: the architectural 'pattern' that haunts every senior dev's nightmares