Proving CSS is OOP: encapsulation, inheritance, abstraction and polymorphism, fight me
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
34Comment deleted
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
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
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
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
If CSS is OOP, specificity is multiple inheritance and !important is the global variable your architect warned you about
C++ lifers spotting Python: 'Managed memory? That's not programming, that's delegation to the GC mafia.'
Already uploaded Comment deleted
бред Comment deleted
please use English in this chat Comment deleted
complete nonsense Comment deleted
why Comment deleted
https://t.me/dev_meme/3667 rules Comment deleted
*documentation* Comment deleted
should be read at lest once before coding Comment deleted
that's what the rules are Comment deleted
Closing as a duplicate of the previous post Comment deleted
Also, i disagree with the post. being a progrming langue is more than how properties propagate through objects. Comment deleted
nope Comment deleted
Okay lmao Comment deleted
they proved its object oriented but not that its a programming language Comment deleted
What does define whether it is programming language? Comment deleted
if its a list of instructions for a computer to sequentially execute Comment deleted
css is merely a configuration format like json or yaml Comment deleted
haskell? Comment deleted
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 Comment deleted
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. Comment deleted
You can implement algorithms with it, though Comment deleted
CSS even has timeouts, global and local scope variables Comment deleted
what? it hasn't got timeouts. And scoping is cascading, just like the styles. Comment deleted
transition property is that timeout Comment deleted
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 Comment deleted
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 Comment deleted
But I fully support that message Comment deleted
I think CSS is a domain-specific language. Comment deleted