The Definitive, Unimpeachable Guide to Code Brace Styles vs. Mental Disorders
Why is this CodeQuality meme funny?
Level 1: Little Difference, Big Argument
Imagine two people arguing over the right way to do something that doesn’t really matter. For example, think about the way a toilet paper roll hangs. One person insists the paper must hang over the roll, while the other swears it should hang under. The toilet paper itself works the same no matter what, but each person is absolutely sure their way is “correct” and the other way is totally wrong. They might even playfully call each other crazy for preferring the “wrong” way!
This meme is the coding version of that situation. All the programmers in the picture are writing the exact same loop that does the same thing, but they’re fighting about a tiny detail: where to put a curly brace { character in the code. One style puts the { on a new line, another style puts it on the same line – it’s a bit like arguing over vs. under for the toilet paper. It doesn’t change what the program does at all (just like the toilet paper still works), but each programmer feels very strongly about their way being the best. The meme jokeingly labels the two most common ways as normal “code styles” (that’s the green circle), and then calls the other, more odd ways “mental disorders” (the red circle), as if only a crazy person would use them. Of course, it’s all an exaggeration meant to be funny. It shows how even very smart people (programmers) can end up in big arguments over little differences. We laugh at the picture because we recognize it’s a silly, exaggerated version of real debates – just like you’d laugh if two friends seriously argued about something like the “right” way to hang a toilet paper roll or the “proper” way to slice a sandwich. The code works the same either way, so calling one style sane and the others insane is a playful way to tease how picky we can be about personal preferences.
Level 2: Brace Placement 101
For a less experienced developer or someone new to C-style languages, this meme is highlighting differences in CodeFormatting (the visual layout of code) – specifically how people place the curly braces {} that mark the start and end of a block in code. All the code snippets in the image do the exact same thing (loop while x == y, then call func1() and func2()), but they use different indentation and brace placement. These variations have names and come from various code style guides and traditions. Here are the key styles featured:
Allman style (aka "BSD style"): The opening
{brace goes on a new line, directly below thewhile(orif/for) statement, and the closing}is on its own line directly below the start of the block.
Example:while (x == y) { func1(); func2(); }Why use it? It clearly separates the block in a vertical way, which some find improves readability because you can visually match the braces in a column. Many C++ and C# codebases (especially influenced by Microsoft/Windows style) use Allman, and it’s common in the CodeQuality mantra of “make it easy to read.”
Kernighan & Ritchie style (K&R): The opening
{is on the same line as thewhilestatement (right after the condition, with a space before the brace), and the closing}is on a new line aligned with the beginning of thewhile.
Example:while (x == y) { func1(); func2(); }Why use it? It saves vertical space and keeps the code more compact. This was the style used in the original C programming book by Brian Kernighan and Dennis Ritchie, and it became very popular. Many languages (C, Java, JavaScript, etc.) adopt a variation of K&R as their default. It’s sometimes jokingly called the "One True Brace Style."
GNU style: The opening brace is on a new line indented by one level (usually 2 spaces) from the
while. The closing brace is indented the same amount, so the braces themselves are indented alongside the block content, instead of aligning with thewhile.
Example (GNU):while (x == y) { func1(); func2(); }This style is defined by the GNU project’s guidelines (you’ll see it in GNU C libraries and tools). It looks a bit offset compared to Allman or K&R, and if you’re not used to it, the braces appearing further right can be jarring.
Whitesmiths style: Similar to GNU in that braces go on their own lines and are indented, but typically the indent is a larger uniform amount (e.g. 4 spaces). In Whitesmiths style, the braces align with the indented block of code, not with the
whilestatement. It’s named after a company (Whitesmiths Ltd) that had an early C compiler and coding standard. This style was taught in some very old programming guides, but you won’t see it much today. It makes the block of code visually stand out, but at the cost of having braces “floating” away from the left margin, which many find odd now.Horstmann style: A less common variant named after computer scientist Cay Horstmann. It’s kind of a middle ground: typically the opening brace stays on the same line as the statement (like K&R), but the closing brace might be placed unusually (for example, on a new line indented to the same level as the inner code, rather than aligning with the
while). The idea was to keep the opening brace with the statement for compactness, but still visually offset the closing brace. It’s not a widely adopted style, so seeing it can be a surprise – hence it lands in the “weird” category in this meme.Haskell style braces: This one is essentially a joke in the meme context – Haskell is a language that normally doesn’t use braces and semicolons in the same way C does (Haskell uses whitespace indentation or the
donotation with layout rules). If you explicitly use braces in Haskell, you must also use semicolons to separate statements. So a "Haskell style" brace placement in C code isn’t standard at all; it might imply doing something quirky like placing braces in a way to mimic Haskell’s offside rule (indentation-based) formatting. The meme includes it to be funny – it suggests that applying Haskell’s approach to brace placement in C is basically absurd (hence in the "Mental disorders" bubble).Ratliff style: Another rare, idiosyncratic style – presumably named after a developer (possibly Edwin Ratliff or someone who advocated it). Not many modern developers are familiar with this one. It might involve odd choices like putting the closing
}on the same line as the last statement of the block, or other non-standard indenting. In short, it’s a personal or archaic style you almost never see. The meme includes it as an example of an extremely uncommon way to format braces, to the point where most people would find it *wrong at first glance.Lisp style braces: Lisp languages use parentheses
()for code structure, and Lisp programmers sometimes align closing parentheses in columns or stacks at the end of code blocks. By referencing "Lisp style," the meme exaggerates a brace format that would feel alien in C. Think of it like having a bunch of closing braces}}}}lined up together or highly indented in a strange way – analogous to how a chunk of Lisp code might end with)))). There isn’t an actual standard “Lisp brace style” for C, since Lisp isn’t a brace-using language. This is included purely for laughs to imply “so crazy only a Lisp (which doesn’t even use braces) would do something like this.”
In the image, the green bubble labeled "Code styles" groups the Allman and K&R examples, implying these are normal, widely-accepted ways to format code blocks. Indeed, if you learn C, C++, Java, or C#, you’ll probably encounter or be taught one of those two styles first. They’re safe, common conventions. The red bubble labeled "Mental disorders" groups all the others as if to say “only a crazy person would format code this way.” Of course, that’s an exaggeration for comedic effect. Each of those other styles did exist for a reason – for instance, GNU style is the norm if you contribute to GCC or Emacs code, and Whitesmiths was in textbooks in the 1980s – but they are far less common now. The meme leverages the surprise factor: if you show a modern programmer code in, say, Whitesmiths style, they might do a double-take and jokingly ask “Who indented this, an alien?!”
This is classic programming humor: fighting over where to put braces is a rite of passage in developer communities. It’s part of the larger indentation/style debates that also include things like the tabs vs spaces argument. The meme simplifies it into a chart as if it’s diagnosing sane vs insane behavior. For a new developer, the takeaway is that there are multiple valid ways to format braces, but each team or language tends to pick one and stick with it. These preferences get codified in CodeStyleGuides so that everyone on the project formats their code consistently. It might seem silly that engineers care so much about spaces and line breaks, but consistent formatting makes code easier to read and maintain (which is part of overall CodeQuality and good team hygiene). It also improves the team’s developer experience by reducing petty friction – people can focus on what the code does, not how it looks. These days, we often use automatic formatters, so we don’t literally believe other styles are a “mental disorder”! The meme is funny because it pushes a tiny preference to an extreme, joking that only the “normal” style is sane and everything else is crazy. It’s a light-hearted reminder that, yes, developers can be very opinionated about trivial things, and that in the end it’s all in good fun as long as the job gets done.
Level 3: The Fine Line Between Style and Insanity
The meme lampoons the perennial brace_placement_wars that have raged in programming culture for decades. It presents a grid of nearly identical code snippets – each a while (x == y) loop invoking func1(); and func2(); – differing only in how the curly {} braces and indentation are arranged. For seasoned developers, this immediately evokes memories of intense debates over CodeFormatting preferences. The humor comes from how something so trivial (where to put a brace in a while loop) can be treated as a litmus test for sanity. In the image, a green bubble labeled "Code styles" circles the Allman style and Kernighan & Ritchie style (K&R), implying these are acceptable, sane conventions. Meanwhile, a red bubble titled "Mental disorders" encloses more eccentric styles – GNU style, Whitesmiths style, Horstmann style, Haskell style braces, Ratliff style, and Lisp style braces – essentially calling those formatting choices crazy. This exaggeration is a form of DeveloperHumor: it's funny because many of us have seen colleagues react as if non-standard brace styles were a personal affront or a sign of madness.
On a deeper level, this joke highlights how programmers engage in pseudo-LanguageWars and "holy wars" over coding conventions. The braces don't affect the compiled program at all – compilers ignore whitespace and line breaks in C-like languages – but humans care deeply about CodeReadability. Each style reflects a different philosophy: readability vs. compactness, tradition vs. niche preference. For example, K&R style (sometimes nicknamed “Egyptian braces” for how the brace snuggles up to the code) was introduced by the creators of C and prized for saving vertical space on old terminals. Allman style (also known as BSD/ANSI style) uses line breaks around braces to clearly delineate blocks, which many find more legible. These two are mainstream enough to be taught in CodeStyleGuides and standard textbooks, hence they get a pass into the "sane" circle. In contrast, something like Whitesmiths style – an older convention with indented braces – or GNU style (used in Free Software Foundation projects) might look oddly offset or too padded to the unaccustomed eye. The meme exaggerates by labeling them as "mental disorders," tapping into the exasperation a developer feels when encountering a bizarrely formatted code block at 3 AM.
Experienced engineers chuckle at this because they've lived through pointless indentation debates and flame wars on forums about brace placement. It's a classic case of bikeshedding (Parkinson’s Law of Triviality) in the software world: teams may spend an hour arguing about where to put { and } while ignoring far more important design problems. Why? Because everyone has an opinion on style – it's easy to grasp and visibly apparent – whereas deeper issues (like architecture or concurrency bugs) are harder to tackle. The meme’s red-vs-green categorization is obviously hyperbolic, essentially saying there’s a fine line between a harmless code style preference and what some might consider code-formatting insanity. Senior developers know that consistently following one style – any reasonable one – is what really matters for maintainable CodeQuality. That’s why many projects enforce a single convention via CodeStyleGuides or automated formatters. In fact, the tension captured here has led to tools like clang-format, prettier, and language-specific defaults (e.g. Go’s gofmt) which effectively say “let’s not argue, let the tool decide.” But before such tools were common, code reviews often devolved into nitpicking battles over braces and indent – exactly the absurdity this meme ridicules.
In one corner you have the purists defending their chosen style with almost religious fervor; in the other, the rebels or legacy codebases sticking to a different convention for historical or personal reasons. One tongue-in-cheek slogan even declares:
"There are two types of programmers: those who put the brace on a new line, and those who are wrong."
This kind of playful trash-talk highlights the absolutism behind these debates. The result? A lot of light-hearted banter mixed with occasional serious friction on teams. Seasoned developers have learned to find the humor in it: arguing over brace placement is the ultimate low-stakes, high-opinion battle — entertaining up to a point, but also a reminder not to lose focus on what truly matters (functionality, clarity, actual quality of the code). As absurd as it is, the chart in this meme hits a nerve because it feels too real. We laugh, perhaps a bit sheepishly, remembering times we ourselves ranted in a code_style_wars discussion or left a code review comment like “Nitpick: could you put that brace on a new line? Thanks.” The meme holds up a funhouse mirror to our tendencies, showing that even the smallest stylistic choices can spark outsized debates in the developer world.
Description
An image that presents a strong, humorous opinion on programming code styles for brace placement. The image displays eight different code snippets, each showing a 'while (x == y)' loop with different formatting for the opening and closing curly braces. A light green, hand-drawn circle groups together the 'Allman' and 'Kernighan & Ritchie' styles under the label 'Code styles'. In contrast, a large red, hand-drawn circle encompasses the other six styles: 'GNU', 'Whitesmiths', 'Horstmann', 'Haskell style', 'Ratliff style', and 'Lisp style'. Inside this red circle, the text boldly declares these styles to be 'Mental disorders'. The joke is a satirical take on the 'holy wars' in software development over coding conventions. It hyperbolically suggests that only the two most mainstream C-style brace placements (Allman and K&R) are valid, while all others are signs of derangement. The inclusion of 'Haskell style' and 'Lisp style' is an extra layer of humor, as those languages don't typically use curly braces for control flow, highlighting the absurdity of the argument
Comments
27Comment deleted
The fastest way to start a flame war in a room of senior engineers isn't to bring up microservices vs. monoliths; it's to show this image and declare that the green circle should be red
We can reach consensus on CAP trade-offs in minutes, but show one GNU brace and the room deadlocks harder than a naïve two-phase commit
The real mental disorder is spending three hours in a code review arguing about bracket placement while the production database is on fire and nobody's noticed the SQL injection vulnerability on line 47
After 40 years of programming, I've learned that the real mental disorder isn't your brace style - it's thinking you can win the formatting argument in a code review. The Allman vs K&R debate has claimed more engineering hours than any memory leak, and somehow we still haven't automated this away with prettier/black/gofmt everywhere. The true sign of a senior engineer? Accepting that the codebase uses Whitesmiths style and moving on with your life, because that legacy COBOL migration isn't going to architect itself
After the hundredth PR nit on Allman vs K&R, we made the entire style guide one line: run clang-format - turns out the only scalable opinion is a bot
Brace style is a distributed consensus algorithm disguised as a theological dispute - install clang-format as the single source of truth and stop running Paxos at every pull request
We've mastered Raft consensus for clusters, but brace styles still partition every PR
Lisp style looks sexy, not gonna lie... Comment deleted
In large blocks you may lose track of brackets Comment deleted
but it doesn't actually use this style cause it doesn't even have brackets Comment deleted
mental disorder: diagnosed Comment deleted
allman fans and kernighan & ritchie enjoyers Comment deleted
it has parenthesis, but it is completely fine to style parenthesis like this Comment deleted
haskell also doesn't have brackets Comment deleted
it is actually fun to write haskell code (I like category theory) Comment deleted
Only right way Comment deleted
С#/Java agent provocateur detected. Comment deleted
Wrong Im a C++ dev Comment deleted
I think this is right version Comment deleted
GNU is fine Comment deleted
a cat is fine too Comment deleted
cat? i`m drunk and may be missing something Comment deleted
Google the phrase Comment deleted
https://knowyourmeme.com/memes/a-cat-is-fine-too Comment deleted
jython Comment deleted
the only mental disorder Comment deleted
Python: look what they need to mimic a fraction of our power Comment deleted