Skip to content
DevMeme
2245 of 7435
Language Syntax Showdown: The 'Not Equal' Operator
Languages Post #2498, on Dec 22, 2020 in TG

Language Syntax Showdown: The 'Not Equal' Operator

Why is this Languages meme funny?

Level 1: Not Like the Others

Imagine you have seven friends who all have a special way of saying two things are different. Six of your friends all do the same gesture – for example, they give a thumbs-down to mean “those two are not the same.” But the seventh friend is a bit silly: instead of a thumbs-down, he sticks out his tongue to mean “not the same!” This looks really goofy next to the others. You can’t help but giggle because one friend isn’t following the common way.

That’s exactly what’s happening in the picture. The seven-headed dragon represents seven friends (programming languages). Six dragon heads are doing the normal thing – using the usual sign (!=) to say “these two values are not equal.” The last dragon (Lua) is doing it differently, with a funny squiggly sign (~=), kind of like sticking its tongue out. It still means the same thing – “hey, these are not equal” – but it’s using a wacky way to say it. It’s the odd dragon out. This contrast is what makes the scene funny. Just like how one silly friend in a group of serious friends can make everyone laugh by being different, Lua’s unique way of saying “not equal” makes programmers laugh. It’s a playful reminder that being different can be funny, especially when everyone else is doing things the same way.

Level 2: Same Meaning, Different Symbol

This meme highlights a simple fact: programming languages sometimes use different symbols for the same idea. Here the idea is “not equal to” (the inequality comparison). In most languages, the not-equal operator is written as !=. You read that as “bang-equals” or “exclamation mark equals,” and it means “these two values are not the same.” For example, in Java or Python, the expression 5 != 7 would evaluate to true, because 5 is indeed not equal to 7. The meme shows that six popular languages all use != like this. But one language – Lua – uses a quirky alternative: ~= (pronounced “tilde equals”) to mean the exact same thing. So 5 ~= 7 in Lua is true for the same reason. The only difference is the syntax (the spelling of the operation).

In the image, each dragon head is labeled with a language icon and the symbol that language uses for “not equal.” From left to right, the languages are Java (coffee cup logo), JavaScript (JS yellow shield), C (blue letter C), Python (two-toned snake), Swift (swift bird), R (blue R), and Lua (blue circle with Lua text). Above the first six heads you see !=, meaning all those languages use != to check inequality. Above the last head (Lua’s) you see ~=, indicating Lua’s different operator. The last dragon’s goofy face (tongue out, eyes crossed) is a funny way of saying “this one is odd or silly.” It’s as if the Lua dragon is making a face at the other dragons, teasing them with a different symbol.

Let’s break down each language and its “not equal” operator to be clear:

Language “Not Equal” Operator Example Usage
Java != if (x != y) { ... }
JavaScript != (also !==¹) if (x != y) { ... }
C != if (x != y) { ... }
Python != if x != y:
Swift != if x != y { ... }
R != if (x != y) { ... }
Lua ~= if x ~= y then ... end

¹ JavaScript also has !== which is a stricter “not equal” check that doesn’t do type conversion, but it still uses ! as part of the symbol.

As you can see, six out of seven use the exact same != notation. Lua stands alone with ~=. Functionally, they all mean the same thing: they compare two values and yield a boolean (true/false) indicating whether the values are different. The meme is pointing out this inconsistency in a humorous way. It’s a light-hearted jab at Lua for being the odd one out.

For a junior developer or someone new to these languages, this is a helpful heads-up. If you try to use != in Lua code, you’ll get a syntax error (the code won’t run) because Lua doesn’t recognize !=. Conversely, if you used ~= in Java or Python, you’d also get an error, because those languages don’t know the ~= operator for comparison. Each language has its own grammar rules. Syntax differences like this are something you quickly learn when moving between languages. It might seem trivial, but it can cause bugs or confusion until you remember the correct symbol.

Here’s a quick illustration in Lua code:

-- In Lua, this will NOT work:
if a != b then
  print("Not equal")
end
-- Lua will complain: "syntax error near '!='"

-- The correct way in Lua:
if a ~= b then
  print("Not equal")  -- This will execute if a is not equal to b
end

In the first if statement, we used != like we would in C or Python – but Lua doesn’t understand that, so it errors out. In the second if, we use Lua’s ~=, and it works as expected. The outcome (printing "Not equal") is conceptually the same as in other languages; only the notation changed.

The reason this meme resonates is because every programmer eventually runs into these little differences. It’s a classic SyntaxHumor example: the joke is “haha, every language does it the same… except this one weirdo.” It reminds us that each programming language has a bit of personality. Some languages choose certain symbols maybe for historical reasons or designer preference. Lua using ~= isn’t wrong; it’s just different. If you’re new to Lua coming from, say, JavaScript or Java, you might find it odd at first (and you might type the wrong operator out of habit). But soon you memorize it: “tilde equals” means not equal in Lua. The meme essentially says, “Most languages use != for not-equals, but Lua likes to be special with ~=,” accompanied by a funny dragon picture to drive the point home. It’s a gentle reminder and a joke all in one.

So, the takeaway at this level: “not equal” is a common operation, but each language decides how it wants the code to look for that check. Six popular languages agreed on one way (!=), and one popular scripting language (Lua) chose another (~=). It’s the same meaning expressed with a different symbol. That inconsistency is what makes the meme funny and memorable. Once you know this quirk, you’ll be in on the joke— and you won’t be as confused when you spot a tilde in Lua code!

Level 3: Operators Not Created Equal

In this meme, a seven-headed dragon represents seven programming languages, and each head’s label shows that language’s “not equal” operator. The first six dragon heads (for Java, JavaScript, C, Python, Swift, and R) all proudly display the familiar != symbol. They’re snarling and serious—absolutely united in syntax. But the seventh head (labeled Lua) is making a derpy face with its tongue out, and above it is the oddball ~= operator. This visual gag immediately clicks with experienced developers: six mainstream languages agree on using != for inequality, while Lua sticks its tongue out at convention with ~=.

Why is this funny to a seasoned dev? Because it pokes at a classic LanguageQuirk. We expect fundamental operators like “not equal” to be consistent, especially across popular languages. After all, C-style syntax has dominated: if you know C’s !=, you’re set for Java, JavaScript, Python, Swift, even R (which borrows a lot of C-like notation despite being a stats language). All these languages treat != as “not equal to” by design or adoption – a near-universal convention. Then comes Lua, the quirky one, using ~= instead. It’s as if six serious dragons agreed on the rules, and the seventh goofy dragon said, “Nah, I’ll do my own thing!” This juxtaposition is the humor: the inequality operators themselves are not equal across languages – oh, the irony!

Many developers have felt this pain. Imagine bouncing between projects in different languages: in your Java code you write if (a != b) {...} without a second thought. Later, you switch into a Lua script and instinctively type if a != b then ... – and Lua throws a fit (a syntax error). Cue the developer’s facepalm: “Right… Lua uses ~=!” That moment of confusion and self-reminder is almost a rite of passage. The meme captures it perfectly with Lua’s dragon head looking embarrassingly cross-eyed. We laugh because we’ve been there – tripped up by a tiny syntax discrepancy. It’s a shared “ugh, got me!” experience across the programming community.

From a senior perspective, this reflects how language design decisions echo their lineage or break from it. C introduced != over 50 years ago (borrowing the idea of ! for NOT from earlier languages and pairing it with =). It became a de facto standard: languages influenced by C or aiming for familiar syntax (like Java, JS, C++, C#, Swift, etc.) all adopted != for “not equal.” Even Python, which isn’t C-based, initially allowed both != and the Pascal-style <> for not-equal – but by Python 3, Guido van Rossum said “enough” and standardized on != only. In other words, most modern languages gravitated toward != for consistency. Lua, however, was created in the early 1990s with a more Pascal/Ada-like aesthetic in mind (those languages often avoid !). Lua uses English keywords like and, or, not instead of C’s &&, ||, !. So the designers probably felt ~ reads as a logical NOT (in some math and logic notation, “∼” means “not” or “complement”). Thus ~= in Lua cleanly conveys “not equal” within Lua’s design. It’s a deliberate divergence, not an accident. Kind of Lua’s way of saying “I’m my own dragon!”

This little syntax war (!= vs ~=) is all in good humor. It’s tagged as SyntaxHumor and LanguageWars because developers often joke about arbitrary differences like this. One could imagine a playful exchange:

  • Many Languages: “We all use != for not-equals. It’s straightforward.”
  • Lua: sticks out tongue “Tilde equals, FTW!”

Of course, no one is actually fighting over ~=; it’s a tongue-in-cheek way to highlight that each language has its idiosyncrasies. The multi-headed dragon meme template is perfect here: it visually emphasizes conformity vs. oddball. Six heads aligned with the same != operator, and one wild head representing Lua’s rebellion quirkiness. It resonates with experienced devs because we’ve seen this pattern repeatedly — from newline vs semicolon termination, to array indexing starting at 0 vs 1 — and it always causes a mix of frustration and fond amusement. This meme zooms in on one of the most trivial yet emblematic examples. Not equal in meaning, not equal in syntax. Seasoned programmers find it hilarious and comforting: even something as simple as “not equal” can’t escape the diversity (or chaos) of language design. It’s a nod that despite all our standards, there’s always that one outlier... and honestly, we’d kind of miss these little surprises if everything were perfectly uniform.

Description

A meme using an extended version of the 'Ghidorah, the Three-Headed Monster' format to compare the 'not equal' operator across different programming languages. The image displays a series of seven menacing, golden dragon heads, each representing a programming language with its logo on its forehead: Java, JavaScript, C, Python, Swift, and R. Above each of these serious-looking heads is the standard '!=' operator. In stark contrast, the last dragon head on the far right is depicted as goofy and cross-eyed with its tongue sticking out. This dragon represents the Lua programming language, and above it is its unique 'not equal' operator, '~='. The humor comes from highlighting Lua's syntactical divergence from the de facto standard adopted by many other popular languages, portraying it as the quirky, unconventional outlier in the programming world

Comments

7
Anonymous ★ Top Pick Lua's `~=` isn't a bug, it's a feature to keep out developers who can't handle a little syntactic diversity. It's the Dvorak keyboard of operators
  1. Anonymous ★ Top Pick

    Lua's `~=` isn't a bug, it's a feature to keep out developers who can't handle a little syntactic diversity. It's the Dvorak keyboard of operators

  2. Anonymous

    Six committees agreed on “!=”; Lua’s sole architect shipped “~=”, and two decades later every polyglot diff tool still lights up like a merge conflict whenever we touch the scripting layer

  3. Anonymous

    After 20 years in tech, you realize the scariest monster isn't any of these languages - it's the Frankenstein's monster of all seven running in production because nobody documented why we needed each one

  4. Anonymous

    After 30 years in the industry, you've memorized every language's quirks - except you still Google 'lua inequality operator' every single time because your muscle memory refuses to accept that ~= is a thing. It's like Lua looked at the entire programming language ecosystem's consensus on != and said 'nah, I'm gonna be special' while the rest of us are just trying to context-switch between five different codebases without accidentally writing Python syntax in our Java

  5. Anonymous

    We built a cross-language SDK assuming "!=" was portable; prod taught us that "!=", "!==", vectorized "!=", and "~=" are four outages disguised as punctuation

  6. Anonymous

    Polyglot muscle memory types "!=" everywhere; the one Lua file in prod replies "~=", and your pager agrees

  7. Anonymous

    Languages rampaging through prod: C bytes heads off, Rust panics safely, Lua just embeds twice and yields

Use J and K for navigation