Bence Meszaros
2 min readSep 20, 2024

--

You did not answer my question and we have veered off topic, but I'll bite.

I think CSS is a horribly designed language that needs constant patching to be even barely usable, that is why we have more and more new features in the browser not because it is a viable alternative to JS. (By the way JS itself is also getting a ton of new stuff in the browser, even UI related.)

JS is far from being perfect, but CSS is a much worse language that lacks support for writing proper logic, even though virtually any UI problem can be solved much easier using basic mathematical and scripting concepts like geometry, operators, conditionals, variables, functions, types, objects and so on. These are extremely simple, versatile, well established and well known concepts that are available in a wide range of languages from C to Swift to Python, not just in JS.

But instead of adopting these concepts, we have a weird, totally unique language that needs to reinvent the wheel in literally everything, from media queries to pseudo elements, and even these "inventions" are nonsensical like calling a dynamic layout mode static or a relative mode absolute. Fundamental things like freaking tables are completely broken, and even if you come across a seemingly acceptable concept like fixed positioning, it violates literally every core tenet in CSS. This language disregards not just centuries old concepts from typography to graphic design, but even its own fundamental rules.

Sure, if you need something small, fairly static and have a ton of free time to work around endless quirks then go for it. Hell, you don't even need CSS, new things are being built right into HTML every day. But if you need anything other than the default, you'll have a very hard time to achieve your goals using CSS and that is a cost most developers are unwilling to pay.

There are glaring and fundamental issues with CSS that are ignored day after day and the only argument for using CSS remains some nonexistent/insignificant performance gain. You can read literally any of my articles and you'll come to the same conclusion. There is junk JS all over the place, I don't deny that, but we have the option to write better JS, but good luck making CSS even a slightly better language. That is the true performance of CSS (or lack thereof). What you might gain in the browser you lose a thousand times over in developer hours trying to untangle CSS.

I like your thinking and it is somewhat rational: you want to leverage built in stuff that are already in the browser and I get that. But JS is "in the box" too, just like CSS, it just performs much better as a development platform.

--

--

Bence Meszaros
Bence Meszaros

Written by Bence Meszaros

Lead Software Engineer, Fillun & Decketts

Responses (1)