What Every Citizen Should Know about Democracy

I was trained to be apathetic towards politics because of its notoriety for corruption and the fear that I could lose my life as a vocal supporter of an unpopular party. Be that as it may, I have…

Smartphone

独家优惠奖金 100% 高达 1 BTC + 180 免费旋转




Is CSS objectively bad?

Typical discussion on CSS around the web looks like this:

Which is not a constructive conversation. So my question: is there a way to show what is objectively bad about CSS and maybe try to fix it? Stress in this question on objectivity, so it should not be a matter of taste or depend on how you define things, or how you used to do things.

In the article, I try to point out some objectively bad things. Please post your comments with more ideas.

Developers use linters (for example, ESlint), type checkers (for example, TyoeScript, Flow) to automate improve code quality. This is generally not possible with CSS, because how rules applied depends on:

Note: the only way to solve it is to use “CSS reset” and use only atomic styles (e.g. unique class names, no nested styles)

Okay, I said objectively bad and now I use the word “tricky”. Wait for it.

You start learning CSS with selectors and basic properties like color, font, etc. It seems like it is the easiest language in the world. And you can get pretty far with this knowledge.

But then at some point, you need to center something or pull element in flexbox to right and there is no property for it. How to do it? Most developers just search the internet on how to do it and copy-paste snippets from StackOverflow. Next time you need to touch this code and you find that if you change something in one place something else is broken in different. And you get in the circle of doom when you change things until it works.

Or you decide to learn why it doesn’t work the way you expect and you immediately need to learn so many concepts to fix one small thing, like what is box model, how layout algorithm works, etc. All those implementation details are failing on you at once and this is just too much…

This is what I call a tricky learning curve. It becomes a wall at some point.

(It’s up to you to decide if this point is objective or not)

For a long time the only debug tool was:

At the moment there are a lot of great tools implemented by browser vendors, for example:

So things improved, but my point is those improvements come from browser vendors, they are not in CSS spec (or is it and I missed it?). People who designed are never bothered about how it is gonna be debugged.

Add a comment

Related posts:

Elasticsearch document life cycle

An Elasticsearch cluster can have multiple nodes. Each node contains multiple shards. In general, an Elasticsearch index will span across multiple shards residing in multiple nodes. A shard is…

How to handle Tricky Interview Questions?

You have to be ready for these questions so you can give answers that present you in a positive light and allow you to sidestep those little traps. Here are four common — but tricky — interview…

RealChain Project Progress Update

The Themis module is the first RealChain project that uses the “Smart Contract” functionality. This application records the original information of commodity goods and marks the creator institutions…