Skip to content
DevMeme
4381 of 7435
Proving CSS is OOP: encapsulation, inheritance, abstraction and polymorphism, fight me
Frontend Post #4794, on Aug 14, 2022 in TG

Proving CSS is OOP: encapsulation, inheritance, abstraction and polymorphism, fight me

Why is this Frontend meme funny?

Level 1: Tomato Is a Fruit

Imagine two friends arguing about categories. One friend says, “A tomato isn’t a real fruit.” The other friend gets excited and replies, “Of course a tomato is a fruit! Think about it: it has seeds inside, it grows from the flowering part of the plant – those are exactly what make something a fruit. Apples and oranges have seeds and grow from flowers, and so does a tomato. So a tomato fits all the main points of being a fruit. It may not be sweet like typical fruits, but it’s still a fruit by definition. Case closed!” After hearing this, the first friend just blinks, not sure how to respond, maybe a bit annoyed because technically the excited friend is right (even though a tomato is not sweet).

This meme is doing a similar thing, but with coding: one character says “CSS isn’t a real programming language,” and the other one says, “Yes it is! It has all the important qualities of object-oriented programming.” He then lists those qualities one by one, showing examples in CSS. By the end, the first character is left silent and irritated, kind of like the tomato expert who won the argument. The joke is that the enthusiastic character is using fancy criteria to prove his point in a playful way. It feels like a kid passionately defending why their favorite thing meets the official definition of something big. Even if it’s a bit of a stretch, it’s done for comedic effect. Basically, it’s funny because one person is bending the rules of definitions (just like calling a tomato a fruit in everyday conversation can feel funny) to win an argument that doesn’t really matter. The meme makes us laugh at how seriously we sometimes take these labels, and it does so with a silly, over-the-top explanation that leaves the other side stumped – just like our tomato-as-a-fruit champion.

Level 2: Programming in Style

Let’s break down the joke in simpler terms. First, recall that CSS (Cascading Style Sheets) is the language we use to style webpages – it controls things like colors, fonts, layouts, and spacing of HTML elements. When someone says “CSS is not a programming language,” they usually mean that CSS is more about describing appearance than performing logical computations. Unlike languages such as JavaScript or Python, CSS doesn’t execute sequences of instructions or do math; instead, it’s a set of rules that the browser applies to render the page’s look. This has led to endless arguments in the developer world (LanguageWars of nerd kind) about whether writing CSS counts as “coding” or not. That’s the context of the grey character’s statement in the first panel: an NPC saying a common line, “CSS is not a programming language.” The NPC (a meme character for a generic, unoriginal commenter) is basically dismissing CSS as not real programming.

Now the second character – the round, enthusiastic one – jumps in to defend CSS. They ask: “What are the main concepts of OOP?” OOP stands for Object-Oriented Programming, which is a style of programming centered on objects (or classes) that bundle data and behavior. In many college CS courses or programming books, you’ll hear about the four key concepts or “pillars” of OOP: Encapsulation, Inheritance, Abstraction, and Polymorphism. These are big words, but each has a specific meaning:

  • Encapsulation: This is about wrapping up code and data together into a single unit (an object or class), and hiding the internal details from the outside. Imagine a capsule or a container: you put some properties and functions inside an object, and other parts of the program can’t directly mess with the insides unless permitted. They can only use the object’s public methods. It’s like how a car engine is encapsulated under the hood – as a driver you just use the steering wheel and pedals (the interface) without touching the engine’s internal parts.

  • Inheritance: This means a class (think of it like a blueprint for objects) can inherit traits (properties and methods) from another class. It’s like a family: a child class gets features from a parent class. For example, if you have a general class Vehicle and a specific class Car that inherits from Vehicle, then Car automatically has all the general Vehicle features (wheels, can move) without you writing them again. The child class can also have additional features or override some of the parent’s behavior. In human terms, a child might inherit eye color from a parent (automatically having that trait) but might also have some unique features of their own.

  • Abstraction: This is about simplifying complex reality by modeling classes appropriate to the problem, and working at a high level rather than with all details. In practice, abstraction in programming often means you use an interface or an abstract class to outline what something does without specifying how it does it. It’s like using a TV remote – you know which button turns up the volume, but you don’t need to know the electronics inside the TV that make it happen. The complex details are abstracted away, letting you interact with a simple interface.

  • Polymorphism: This literally means “many forms.” In OOP, polymorphism allows the same function or method call to do different things depending on the context. For example, you might have a method draw() that, when called on a Circle object, draws a circle, and when called on a Square object, draws a square. You use the same name draw(), but it works appropriately for different shapes – that’s polymorphism. It’s like a single command that different objects can interpret in their own way. Another analogy: the word “open” means something different if you open a door versus open a file – same action name, but different underlying operations.

Now, the fun part of the meme is that the excited character shows how CSS uses those same concepts, at least by analogy. Let’s go through each OOP concept and see the CSS example given:

  1. Encapsulation in CSS: The meme shows a CSS rule for a class named .myClass:

    .myClass {
      /* encapsulated! */
      color: red;
      font-weight: bold;
      margin: 3rem;
    }
    

    In CSS, a class (prefixed with a dot, like .myClass) groups a set of style properties. Everything between the { } curly braces is a style that applies to any HTML element with class="myClass". The meme annotates this with “/* encapsulated! */” as a joke. They’re saying all these style rules (text color red, bold font, margin spacing of 3rem) are encapsulated inside the .myClass block. In simple terms, the styles are bundled up neatly in one place – kind of like how in OOP, data and methods are bundled inside a class. If an HTML element has that class, it’ll get all those styles applied at once. For someone new: think of .myClass as a named set of styles – a capsule of presentation that you can give to any element. While actual encapsulation in programming also implies hiding those details from other code, in CSS this is more just organizational. But the idea is, each CSS rule is like its own little container of styles.

  2. Inheritance in CSS: The next example uses a class .red:

    .red {
      /* color is inherited! */
      color: red;
    }
    

    And some HTML:

    <div class="red">
      This is red 
      <div>...this too!</div>
    </div>
    

    Here, the outer <div> has class "red", which sets its text color to red. In CSS, many properties, including color, are inherited by default by child elements. That means the inner <div> (which has no class of its own) will also appear with red text, simply because it’s inside an element that is colored red. The meme character says, “Inheritance, like how the CSS properties flow down to the children (+ the cascade).” Cascade refers to how CSS applies styles in a hierarchical manner – parent elements can pass on certain style traits to their children unless the child has its own rule that overrides it. So in the snippet above, both the outer text “This is red” and the inner text “...this too!” end up red, thanks to CSS inheritance. This is analogous to OOP inheritance: just as a subclass automatically has the properties of its superclass, a child HTML element automatically gets the styles of its parent element (for inheritable properties). It’s a simplified parallel, but it clicks: the .red class acts like a “parent style”, and everything inside inherits that redness. If we change .red { color: blue; }, then by inheritance, both texts would turn blue. For a new developer, it’s useful to know that not every CSS property inherits—some do (color, font, text-sizing), some don’t (like layout-related styles). But the meme sticks to color, which clearly demonstrates the concept.

  3. Abstraction in CSS: The comic then talks about abstraction using a <button> example:

    <button class="btn">Styled Button</button>
    

    And the CSS:

    .btn {
      /* ??? some styling ??? */
    }
    

    The .btn class presumably has a bunch of styling (the meme leaves it as question marks, implying “imagine the styles here”). The point the character makes: you can use the class btn on a button element to give it a preset look, without needing to know exactly what styles btn includes. As a developer using that class, you just trust that .btn will make the button look, say, like a nice blue pill-shaped button or whatever the design is. This is abstraction: you’re abstracting away the details of the styling. The HTML markup remains clean (<button class="btn">) and someone reading the HTML knows that it will be a “styled button” by virtue of that class, even if they haven’t inspected the CSS. In programming terms, it’s like calling a method or using a component without caring about its inner workings – you just rely on its interface or name. So .btn here is acting like an interface to a bunch of style rules. Many CSS frameworks use this idea: for example, if you use Bootstrap, writing <button class="btn btn-primary"> immediately gives your button a certain look defined in Bootstrap’s CSS, no need to know exactly how that’s achieved in the CSS file. For a newcomer, the key takeaway is that CSS classes let you reuse styles by name. Abstraction is visible in how HTML and CSS are separate: the HTML is concerned with structure/content (a button element), and CSS is concerned with appearance (the .btn styles). You don’t mix them (if you follow best practices); that separation is a form of abstraction in itself.

  4. Polymorphism in CSS: Finally, the meme illustrates polymorphism with an .awesome class:

    <article class="awesome">Awesome article</article>
    <section class="awesome">Awesome section</section>
    
    .awesome {
      /* some awesome styling */
    }
    

    Two different HTML elements (an <article> and a <section>) are using the same class awesome. This means both of them will be styled identically by the .awesome CSS rule. The character says, “Polymorphism, like using the same class on different HTML elements.” The link to OOP: in programming, polymorphism lets one piece of code work on different data types or classes. Here, one CSS class (one set of style instructions) works on different kinds of elements. The <article> might normally look slightly different from a <section> by default browser styles, but by giving them both class "awesome", we ensure they are presented in a uniform way. Essentially, .awesome is a single “interface” that multiple element types can implement (by having that class). For a front-end dev, this is everyday stuff – we often reuse the same class on various tags to avoid writing duplicate style rules. It’s efficient and consistent. For someone learning, it shows how CSS is very flexible: classes are not tied to specific HTML tags. You can think of it like a costume that can fit any actor – whether the actor is an article or a section, the "awesome" costume will make it look awesome. Polymorphism in code is similar: one function call can adapt to different kinds of objects, and here one class adapts to style different tags similarly.

After going through all these parallels, the excited character declares: “CSS is not only a programming language, it is an object-oriented programming language.” This is the dramatic (and humorous) conclusion. The idea is, since they found examples of encapsulation, inheritance, abstraction, and polymorphism in CSS, they’ve effectively proven that CSS fits the criteria of OOP. It’s a bold, tongue-in-cheek statement – hence the “fight me” vibe (as in, “I’ve made my point, if you disagree, fight me!” which is internet-speak for a playful challenge).

In the final frames, the NPC character has no comeback. He just stares blankly, then looks annoyed. This comedic timing suggests that the NPC either got baffled by the overly technical response or just doesn’t know enough to argue further. It’s the meme’s way of saying the skeptic was silenced by this onslaught of big concepts. To a junior developer or someone newer to these ideas, the humor comes from the mismatch: we usually talk about OOP when discussing Java or C# code, not when talking about CSS. Seeing CSS elevated to that status is unexpected and funny. It’s like hearing someone use grand academic criteria to defend something simple – it’s a bit over-the-top, which is exactly the joke.

This meme is definitely FrontendHumor. If you’ve been doing web development, you might relate to having to explain that CSS, though different from typical programming, still requires logical thinking and skill. Many beginners in web dev might even feel a bit insecure when someone says “HTML/CSS isn’t real programming,” so this comic is a fun counter-argument: it basically says “Hey, I can even match CSS to computer science principles, so take that!” Of course, it’s all in jest – the goal is to amuse, not to truly argue that CSS is Java. But along the way, you actually learn or recall some important CS fundamentals by seeing them in a new light. If you’re a newcomer, don’t worry too much about whether CSS is “programming” – what matters is understanding what it does and how to use it. And as this meme shows, even something like CSS that’s used for styling has parallels to deeper concepts. It’s a lighthearted way to mix CS_Fundamentals with everyday web dev. Plus, now you know those four OOP terms (encapsulation, inheritance, abstraction, polymorphism) and have a quirky example for each!

In essence, the meme is a goofy lesson: it reframes a petty argument into a teaching moment wrapped in a joke. The next time someone tries to gatekeep by saying your CSS work isn’t “real code,” you can jokingly throw these OOP terms back at them – “Checkmate!” – and enjoy their baffled look, much like that NPC’s empty stare. It’s all part of developer culture where we laugh at such debates while sneakily learning from them. CSS might or might not be a “programming language” by strict definition, but it’s certainly an indispensable part of WebDev. And as this comic shows, you can even view it through an OOP lens… if you’re willing to stretch your imagination and have a sense of humor about it.

Level 3: Class Warfare

For seasoned web developers, this meme hits on a familiar humorous debate. It’s portraying the tug-of-war between front-end developers who feel that their work is “real programming” and those skeptics (often back-end or traditional developers) who dismiss technologies like CSS as “not a programming language.” This is a long-running language war in dev circles – akin to the endless threads arguing whether HTML and CSS count as “programming” or whether they’re just “markup” or “design tools.” The meme uses the popular NPC meme format: the gray, expressionless NPC (non-player character) face represents a generic naysayer parroting a common opinion (“CSS is not a programming language”), while the enthusiastic drawn figure represents the passionate front-end dev who’s armed with witty comebacks. It’s a classic setup of RelatableHumor in tech: one side makes a dismissive statement, and the other side counters with over-the-top logic to defend their turf.

What really makes experienced devs smirk here is how the defense is mounted: by invoking the holy tenets of OOP that we all learned in CS101 or from thick C++/Java textbooks. The excited character asks, “What are the main concepts of OOP?” and proceeds to demonstrate each with a CSS twist. This systematic approach is both nerdy and absurd – exactly the kind of DeveloperHumor that circulates on forums and Slack channels. Each OOP concept is matched with a snippet of CSS/HTML from everyday Frontend work, turning a serious CS fundamental into a punchline:

  • Encapsulation: The meme shows a code block for a CSS class .myClass with various properties inside it, commented /* encapsulated! */. The character explains that all the CSS properties are encapsulated in a rule. This is funny to a senior dev because we know that real encapsulation involves restricting access to an object’s internals, whereas in plain CSS, one rule can override another due to the cascade. CSS’s global nature has historically caused anything but encapsulation (we’ve all seen one rogue CSS rule mess up styles across a site!). Advanced CSS architecture tries to introduce encapsulation – e.g., Shadow DOM or BEM naming to prevent leakage – so the meme winking at “encapsulation” will elicit chuckles. It’s like saying, “Look, I put my styles in curly braces, all safe and sound!” and veteran devs recall times when that false sense of safety was shattered by !important or specificity wars. The humor is in treating a simple class CSS rule as if it were a robust object boundary.

  • Inheritance: The next panel’s code defines a class .red setting color: red;, and shows an HTML snippet where a <div class="red"> contains nested content. The child <div> inside inherits the text color, so it’s also red. The character says “Inheritance, like how CSS properties flow down to children (+ the cascade).” This resonates because CSS actually does have inheritance behavior for certain properties, and it’s one of its core features (so here the analogy is somewhat legitimate). Seasoned devs know the Cascade in CSS means styles cascade from parent to child elements unless overridden. It’s amusing to call this “inheritance” in the OOP sense – we imagine a Java class inheriting fields from a base class – but in CSS it’s not a strict parent-class relationship, it’s just element hierarchy. Still, the visual of nested HTML elements all turning red because of a parent class is a perfect CSS inheritance example. Experienced folks also recall that not every CSS property is inherited (e.g., margin or border won’t magically apply to children), but the meme glosses over that for the joke. The familiarity of fighting CSS inheritance issues (like accidentally coloring all child tags when you style a container) makes this part relatable. It’s a playful reminder that CSS does have “children inheriting traits from parents”, just like objects in an inheritance chain.

  • Abstraction: Here the meme gets creative. The code snippet shows a <button class="btn">Styled Button</button> in HTML and a CSS rule for .btn { ?????? } (with question marks implying some unknown styling). The character explains, “Abstraction, how we can use a class to style without knowing what’s inside.” This is a clever nod to the idea of separating interface from implementation. In programming, abstraction might mean using a function or an object without needing to understand its inner workings – you rely on a clean interface. In CSS, a class like .btn can be seen as an abstraction layer for a styled button: you as a developer or user of a design system just apply class="btn" in your HTML, and somewhere in your CSS codebase the details of what .btn does (background color, padding, border radius, etc.) are defined. You might not need to look at those details every time – you “abstract away” the gritty styling by reusing the class. For a seasoned dev, this is humorous because it’s taking a very programming-oriented term and applying it to something quite static. We typically don’t talk about abstraction in CSS – we talk about stylesheets and maybe design tokens or variables – but seen this way, a predefined CSS class is like a function you call to get a certain look. The joke here also implicitly pokes fun at how front-end devs create style guide classes or utility classes (like the many utility classes in Tailwind CSS) that you just trust to do their job, much like calling library code. The ?????? in the meme’s .btn CSS is a fun detail – it suggests “fill in the blanks yourself” or “imagine some complex styling here,” reinforcing that the user of .btn doesn’t need to know those details to use it.

  • Polymorphism: The final concept is shown with two different HTML elements, <article class="awesome"> and <section class="awesome">, both using the same class awesome, along with a CSS rule .awesome { … }. The meme character says, “Polymorphism, like using the same class on different HTML elements.” In classical OOP, polymorphism means one interface or method can work with different underlying forms (for example, you call draw() on any shape object – a circle or a square – and each object’s own implementation runs). Here, the meme equates that to one CSS class working on multiple element types, making them all look “awesome” in the same way. For a veteran developer, this is a charmingly simplified analogy: it’s true that .awesome styles can apply to an <article>, a <section>, a <div>, you name it – CSS doesn’t care what the tag is, it will style any element that carries that class. That is like one “method” being available to different object types. Of course, we know CSS is not choosing different behavior based on the element type (the style is literally identical) – whereas in real polymorphism, say a method could behave differently on different subclasses – but the meme isn’t aiming for nuance, it’s aiming for the broad grin that comes from recognizing the buzzword usage. It also subtly references how in front-end development we use classes in a DRY (Don’t Repeat Yourself) way to apply consistent styling – analogous to reusing code. A senior dev might chuckle remembering how we sometimes jokingly refer to a CSS class as if it were a piece of reusable logic (e.g., “just slap the awesome class on it and voila!”). It’s polymorphism with a wink.

After going through each CS fundamental concept and matching it with a Frontend counterpart, the triumphant character concludes: “CSS is not only a programming language, it is an object-oriented programming language.” This line is the kicker – it exaggerates the argument to a comical extreme, which is exactly the point. It’s almost memetic mic-drop. The NPC character is left speechless and then scowling. For those of us in on the joke, this ending is relatable: we’ve all seen online debates where one side bombards the other with fancy terminology or edge-case logic to make a point, leaving the opponent either stunned or exasperated. The NPC’s blank stare followed by angry frown encapsulates that “I have no counter-argument, but I’m not happy about it” feeling. It’s a classic meme trope to have the skeptic’s brain short-circuiting when confronted with an unexpected wall of logic (even if it’s half-serious logic).

In a broader sense, this meme satirizes both the passion of CSS defenders and the silliness of strict gatekeeping in programming. Seasoned developers know that arguing about “is X a real programming language” is a bit of a nerd trap – it rarely matters for getting the job done, but it sure can spark fiery discussions on Reddit or Stack Overflow. Here the meme maker chooses to side with the CSS camp in a tongue-in-cheek way, basically saying “You want OOP? Fine, I’ll show you OOP in CSS!” It’s an example of turning a LanguageWar argument on its head with humor. The use of concrete code examples for each OOP principle also shows an insider familiarity with both CSS and the textbook definitions – it’s the kind of humor only developers who know both worlds will fully appreciate. If you’ve written CSS, you know these examples are real things (you do inherit color, you do reuse classes across elements), and if you’ve studied OOP, you recognize the terminology. The mashup is absurd and delightful, making this a highly RelatableHumor piece for web developers.

One more layer for the seasoned dev: the meme inadvertently reminds us of actual attempts to bridge CSS and software engineering principles. For instance, there’s a methodology literally called “Object Oriented CSS (OOCSS)” that was popularized around 2010, encouraging developers to write CSS in a modular, reusable way (using classes as design “objects” and separating structure from skin). Of course, OOCSS is more about good CSS architecture than about actual object instances, but the terminology shows that even professionals have jokingly borrowed OOP vocabulary to talk about CSS best practices. Similarly, terms like “CSS inheritance” and “encapsulation” come up when discussing things like the cascade or CSS scopes (think of frameworks enforcing style isolation so one component’s styles don’t bleed into another’s – that’s essentially trying to achieve encapsulation in CSS). So the humor works on multiple levels: it’s poking fun at a classic newbie argument, it’s flexing some CS lingo in a nonsensical way, and it’s winking at the fact that CSS architecture sometimes borrows concepts from software design.

In the end, experienced devs laugh because we’ve been there – either defending our front-end work to a skeptical colleague or just enjoying the absurdity of comparing .myClass { color: red; } to a full-fledged class in C++ with private members and virtual functions. It’s a fight me meme: the author facetiously throws down a gauntlet saying “Prove me wrong!” while knowing the premise is exaggerated. The NPC’s reaction is the only reply possible: stunned silence and simmering annoyance. It’s an inside joke that both pokes fun at CSS’s simplicity and complexity. After all, CSS can be notoriously tricky (center that div, I dare you!), and many a developer who scoffed at it has been humbled by its quirks. So there’s a bit of pride in the excited character’s stance – an almost rebellious "CSS is code too!". This comic snapshot of the css_oop_debate is a lighthearted reminder that in tech, we sometimes take our definitions too seriously. And if you push those definitions in creative ways, you get comedic gold like this, where a stylesheet is crowned a programming language just because it happens to have “classes” and “inheritance” in its own special sense. It’s FrontendHumor at its finest – turning a technical argument into a visual joke that developers can bond over.

Level 4: Paradigm Paradox

At the deepest level, this meme pokes at what defines a programming language and an object-oriented one at that. In computer science theory, a programming language is often expected to be Turing-complete – capable of implementing any algorithm given enough resources. CSS (Cascading Style Sheets), in its pure form, is not Turing-complete: it’s a declarative styling language that describes what elements should look like, rather than giving step-by-step instructions or logic. There are no loops, no conditional branches in plain CSS – you can’t calculate Fibonacci or implement sorting with just CSS rules. By academic standards, CSS is a domain-specific language focused on presentation. Meanwhile, Object-Oriented Programming (OOP) is a paradigm where code is organized into “objects” that contain data and methods, emphasizing concepts like encapsulation of state, class-based inheritance hierarchies, and polymorphic behavior through dynamic dispatch of methods. These ideas trace back to languages like Simula and Smalltalk in the 1960s-70s, where objects were little instances sending messages to each other. From that purist vantage point, claiming CSS exhibits all pillars of OOP is a humorous stretch: CSS has no notion of “objects” with methods or message passing, no actual inheritance of behaviors like a subclass overriding a parent class’s method, and certainly no runtime polymorphic method dispatch.

However, this meme isn’t attempting a rigorous CS thesis – it’s a playful paradox of paradigms. It takes the high-level language of OOPEncapsulation, Inheritance, Abstraction, Polymorphism – and maps those concepts onto CSS constructs. Academically, one could debate if these mappings hold water. For example, encapsulation in OOP is about hiding internal data and requiring all interaction through an object’s methods (think of an object as a capsule). In CSS, styles for a class are grouped in one rule set – a very loose analogy to encapsulation, since CSS does not truly hide properties (any other CSS rule of higher specificity can override them – the opposite of strict encapsulation!). Inheritance in OOP usually means a class inherits methods and fields from a parent class. In CSS, inheritance refers to how certain style properties (like color or font-family) are automatically applied to an element’s children in the DOM tree unless changed – a concept more rooted in the cascade logic of style resolution than classical inheritance hierarchies. Polymorphism in OOP is about objects of different classes being treated through the same interface, often via method overriding or interfaces. The meme equates that to using the same CSS class on different HTML elements, so those distinct element types end up looking uniform – a form of “one style, many elements” that cheekily echoes “one interface, many implementations.” And abstraction in OOP means exposing only the necessary features and hiding complexity (like how you use an API without knowing its internal code). In CSS terms, applying a class like .btn to a <button> is an abstraction in that the HTML element doesn’t show all the styling details – they’re defined elsewhere.

From a theoretical perspective, the joke shines light on how definitions can be bent. It’s almost tongue-in-cheek proof by analogy. The enthusiastic character is essentially saying: “If it walks like a duck and quacks like a duck, maybe it’s a duck.” They list the four big OOP buzzwords and show that CSS has something that quacks similarly. It’s a form of category play, akin to those cheeky academic exercises where someone finds a way to simulate computation in an unlikely system. (In fact, there have been esoteric proofs-of-concept of doing logic with CSS selectors, but those are more puzzles than practical programming.) The meme’s punchline rests on the absurd confidence of declaring CSS not only a programming language but an object-oriented one – which is a delightful contradiction to anyone who learned OOP from Java or C++. It’s referencing the “language wars” in a highly literal way: using the sacred terms of one paradigm to crown CSS as a peer. The paradox is that under rigorous definitions, CSS doesn’t meet the usual criteria – yet the broad conceptual similarities are presented as if that’s enough. This clever role-reversal makes us consider how flexible (or flimsy) those definitions can be in casual debate. In summary, Level 4 reveals the humor in mixing paradigms: academically, calling CSS an OOP language is like fitting a square peg in a round hole. But by cherry-picking broad traits, the meme creates an ironic proof that blurs the line between a style sheet and a full-fledged programming paradigm, just for the fun of it.

Description

Vertical eight-panel comic on cyan background. Panel 1 shows an expressionless NPC head saying, “CSS is not a programming language.” Panel 2’s round, enthusiastic character replies, “Of course it is! What are the main concepts of OOP?” Subsequent pairs of panels show code snippets beside the excited character explaining each OOP concept with CSS: 1) encapsulation - “.myClass { /* encapsulated! */ color: red; font-weight: bold; margin: 3rem; }”; 2) inheritance - “.red { /* color is inherited! */ color: red; } <div class="red"> this is red <div>…this too!</div></div>”; 3) abstraction - “<button class="btn"> styled button </button> .btn { ?????? }”; 4) polymorphism - “<article class="awesome"> awesome article </article> <section class="awesome"> awesome section </section> .awesome { … }”. In the sixth frame the cheerful character triumphantly states, “CSS is not only a programming language, it is an object-oriented programming language.” The final two frames show the NPC staring blankly, speechless. The meme humorously reframes front-end styling rules using classical OOP terminology, sparking the perennial debate about whether CSS counts as a real language

Comments

34
Anonymous ★ Top Pick CSS nails OOP: encapsulate hacks in .legacy, inherit 15 years of !important, abstract layout sins behind .btn, then watch each browser polymorph it into its own pixel math - front-end’s take on eventual consistency
  1. Anonymous ★ Top Pick

    CSS nails OOP: encapsulate hacks in .legacy, inherit 15 years of !important, abstract layout sins behind .btn, then watch each browser polymorph it into its own pixel math - front-end’s take on eventual consistency

  2. Anonymous

    After 15 years of arguing whether CSS is Turing-complete, we've finally achieved something more impressive: making senior engineers question if their entire mental model of programming paradigms needs a !important override

  3. Anonymous

    Ah yes, the classic 'CSS isn't a programming language' debate - until someone maps OOP principles onto it and suddenly your `.btn` class is exhibiting polymorphic behavior across semantic HTML elements. Next thing you know, you're explaining to stakeholders why refactoring the cascade is actually technical debt mitigation, and your CSS architecture document references SOLID principles. The real abstraction here? Convincing yourself that `!important` isn't just a global variable in disguise

  4. Anonymous

    CSS is OOP: cascade as multiple inheritance, specificity as the diamond-resolution algorithm, and !important as the global mutable state we rebrand as a pattern

  5. Anonymous

    If CSS is OOP, specificity is multiple inheritance and !important is the global variable your architect warned you about

  6. Anonymous

    C++ lifers spotting Python: 'Managed memory? That's not programming, that's delegation to the GC mafia.'

  7. @tohir_ahmad 3y

    Already uploaded

  8. @mnik01 3y

    бред

    1. @sylfn 3y

      please use English in this chat

    2. @mnik01 3y

      complete nonsense

  9. @mnik01 3y

    why

    1. @sylfn 3y

      https://t.me/dev_meme/3667 rules

      1. dev_meme 3y

        *documentation*

        1. @sylfn 3y

          should be read at lest once before coding

    2. @feedable 3y

      that's what the rules are

  10. @dmitry_polshakov 3y

    Closing as a duplicate of the previous post

  11. @ygerlach 3y

    Also, i disagree with the post. being a progrming langue is more than how properties propagate through objects.

  12. @poniraq 3y

    nope

  13. @nohat01 3y

    Okay lmao

  14. @sashakity 3y

    they proved its object oriented but not that its a programming language

    1. @azizhakberdiev 3y

      What does define whether it is programming language?

      1. @sashakity 3y

        if its a list of instructions for a computer to sequentially execute

        1. @sashakity 3y

          css is merely a configuration format like json or yaml

        2. Deleted Account 3y

          haskell?

  15. @nohat01 3y

    Bullshit, a programming language is a language that is able to satisfy any algorithmic form, I studied this last year in cs engineering program, css can't satisfy any algorithmic form, except, :not

  16. @amadare42 3y

    css IS programming language. Not general-purpose one though. You don't actually need language to be Turing-complete to be considered programming language. It very well fit to "declarative programming language" definition. Another example is xml. It is just data structure and cannot be considered programming language. But then you can use XSLT on top of that that not only Turing-complete but also debuggable with breakpoits and all. CSS is object-oriented programming language. That doesn't mean that you want/can implement algorithms in it.

    1. dev_meme 3y

      You can implement algorithms with it, though

    2. @azizhakberdiev 3y

      CSS even has timeouts, global and local scope variables

      1. @RiedleroD 3y

        what? it hasn't got timeouts. And scoping is cascading, just like the styles.

        1. @azizhakberdiev 3y

          transition property is that timeout

          1. @RiedleroD 3y

            it's an asynchronous timeout, yes, but you can't use it for control flow since you can't react to anything set in CSS from CSS besides variables, which can't use values from outside CSS

            1. @azizhakberdiev 3y

              js also has not syncronous timeout, but there are ways to imitate syncronous timeout using special syntax. It could be done in css, but I dont know how

    3. @lab0rat 3y

      But I fully support that message

    4. Deleted Account 3y

      I think CSS is a domain-specific language.

Use J and K for navigation