Why don’t developers like CSS?

Manon Carbonnel
6 min readSep 22, 2022

--

Peter Griffin — American Dad

It seemed obvious to me to write my first web integration article on this popular phrase:

“I don’t like CSS”

Who hasn’t heard or said this phrase before?

To be honest, every time I hear it, I want to answer that we like what we master.

A “real” language ?

I suggest we deconstruct this received idea:

“CSS is not a programming language”

SPOILER : Yes, CSS is a programming language (and so is HTML).

Let’s take a step back and get back to basics:
What is programming? Programming is giving computers instructions, telling them what to do according to our wishes. These languages are being used only to give these instructions, they are intended for computers and not humans. And for good reason: if the languages were not interpreted, our websites would only display sequences of HTML tags and lines of CSS.

It is also not a natural language: it is not intended for communication between human beings, but for programs. Admittedly, it requires a browser to be interpreted, but any language needs its support to function.

“CSS is not Turing complete”

Turing completeness means capable of performing the same actions as a Turing machine. If CSS is indeed not Turing complete on its own (as is the case with HTML and SQL languages), combined with HTML and human interactions, we can use it to encode the famous rule 110, and thus obtain a Turing complete set.

Intended to be used with HTML (domain-specific), it indicates many behaviors to web browsers (colors, animations, transitions, positioning, events, …)

A real language then, with all the possibilities it offers to allow us to create interfaces that are not only beautiful, but also practical and accessible, which are intended for humans.

Cascading

What makes CSS so different from other languages is the priorities that come with the notion of cascading.

Beyond the order in which the lines of code are read by browsers, several elements influence the way in which the rules are applied: the proximity to the HTML tag, the precision in selecting the elements (class, id, state), and even some keywords like !important.

“CSS is difficult”

This language is declarative and thus has no possibility of controlling its explicit execution order (neither loop nor condition). Its rules are executed linearly by a browser (line by line) and implicitly. Used without a pre-processor like SASS or LESS, it does not include object classes, namespaces, nor the possibility of writing your own functions… Therefore, would it be more difficult to use, in comparison with general-purpose explicit or dynamic languages like Python?

Let’s add the fact that it does not evolve frequently compared to a language like JavaScript. Therefore, spending a minimum of time learning the concept of cascading, priorities, selectors and positioning is enough to feel comfortable with stylesheets.

In the professional environment, I quickly noticed that backend development arouses more prestige in many people. It is true that after having spent design time on architecture and design patterns or resolving complex bugs, it is frustrating to stumble over the positioning of an element in a page… But again, it is a shame to prioritize the steps of creating an application.

The importance of UI and UX is well established, whether for reasons of accessibility, brand image or to generate traffic on our apps. And the more we master our tools, the easier it is to achieve these objectives.

Master the Force

Another reason that may explain the difficulties encountered with CSS comes from the initial training in our professions.

In my experience, learning CSS is done in a lightning way in teaching code. In a way, it’s understandable: there are so many important and complex concepts to learn, but it’s unfortunate to miss one of the crucial steps in creating a website. Knowing that the impression of progress with this language is very fast and very pleasant: a simple refresh is necessary to check the result of our work.

Then, not all projects require developing applications that have a graphical interface. For projects aimed at internal corporate users, a pre-made UI kit like Bootstrap is often sufficient. And many public sites made with WordPress are based on excellent themes offered by the community.

Depending on the business domain, it is not easy to be confronted with CSS regularly and therefore to progress. And when you have to edit some code written by someone who didn’t master the language and wasn’t motivated by their tool, it’s often frustrating and done in a hurry.

It is therefore a place in the code where the technical quality is low, while we want maintainable and scalable applications. As written in the Agile Manifesto “Continuous attention to technical excellence and good design enhances agility.” and the Software Craftsmanship Manifesto “Not only working software, but also well-crafted software”. Just like that.

Noble art

In general, when I say that I am a developer and web integrator, it does not impress much. At best, it may bring relief to some people as I can potentially help the rest of the team with the dreaded UI bug tickets.

Credits @Geoffrey Dieffenbach

On the other hand, when I say that I am a “fullstack” developer and an expert in CSS, I notice that it inspires more. And yet I have already heard:

“Integration, colors, design, it’s more of a woman thing”

This stereotype about apprehending colors and creating “sexy” interfaces is not new and yet persists: it would be more rewarding (and masculine) to develop applications on the business side than on the UI side, or even integrating its design.

This point deserves an article on its own, but I see it as another attempt to prioritize the importance and value of one part of development over others.

“I don’t want to get a headache just to place a button”

There is a paradox between the impression of difficulty and the lack of nobility attributed to language. It would be both too simple to be considered a programming language, and too difficult to be enjoyed.

Some people hesitate or even remove mentions of HTML and CSS from their resumes. And this is a real thing:

Exemple d’entretien technique :D

In summary: CSS is a declarative and domain-specific language, which would be too low complexity, but too complicated to please. Yet, I assure you, not only is it very useful, but:

Bold statement

And when it’s about a programming language it has to be about clean code. We can then address the notions of debug, linters, architecture, optimizations, pre-processors… But that’s for a future article ;)

I absolutely want to show you all this potential, best practices and tips for coding great applications.
So, follow me on my social networks so you don’t miss a thing.

Additional sources

Briefs — “Is HTML A Programming Language?”
https://briefs.video/videos/is-html-a-programming-language/

Lara Schenck — CSS is a Declarative, Domain-Specific Programming Language
https://notlaura.com/css-is-a-programming-language/

Lara Schenck — Is CSS Turing Complete?
https://notlaura.com/is-css-turing-complete/

--

--

Manon Carbonnel

Web developer & integrator - Scrum Master | 🌊 @csscade | 👀 #explosConserto