You never know where the next Grand Debate™ in front-end is going to come from! Case in point: we just saw one recently based on a little Twitter poll by Max Stoiber in which 57% of people got it wrong. There were reactions ranging from the innocuous hey fun a little brain teaser! to the state of web education is in shambles and beyond.
I heard from a number of folks that they just felt sad that so many people don’t know the answer to a fairly simple question. To be fair, it was (intentionally, I’m sure) rather tricky! It wasn’t really a question about CSS — it was more about the idea that the order of HTML attributes doesn’t matter. It’s the order of CSS that does.
One extreme response I saw said that front-end stuff like this is needlessly complicated and getting it wrong is almost a point of pride. This sentiment was so strong that I heard it suggested that people who know the answer have filled their brains with useless information and that somehow makes them a worse developer. Equally extreme were suggestions that writing HTML and CSS raw like that should always be avoided in favor of tooling abstractions to “fix” these “problems.”
(Excuse the quotes there, I’m not trying to pick a side so much as to emphasize that not everyone considers these problems that need to be fixed.)
At the same time, this poll became the perfect mirror to see the strong opinions people have about front-end practices. Fascinating, really.
Here are a few more takes from folks who chimed from their own blogs:
I hate that this has somehow become some “old guard” vs. “new guard” thing.
The problem with drawing lines like this: whichever side you find yourself on, there are some whackos out there throwing ridiculous arguments into the mix. And now people on the other side associate that viewpoint with you.
It doesn’t bother me too much that people are getting the question wrong. Everyone is at different stages in their career and everyone has different problems they’re facing in their daily tasks, so sure, not everyone is going to know this yet.
I do find it a bit alarming just how many folks got it wrong though.
One the one hand (and this will somewhat simplify each ‘side’, for the sake of brevity, not disrespect to either), we have those, and I’d on balance probably include myself in this camp, who’d argue that the core technologies of the Web are precisely that–foundational, and a deep understanding of them conceptually (not necessarily an encyclopedic knowledge of every syntactic aspect) is fundamental working knowledge for professional Web developers.
With the growth of the importance of front-end development, we’re seeing the story play out again.
The systematic devaluation of CSS, and more, the people who use CSS.
The constant “mansplaining” of CSS features to women who literally are the reason it exists.
All of this at a time when CSS is improving faster than ever and enabling dramatic changes in web design.
This isn’t about better technology, it’s about exclusion.
Have you seen any other takes or have any of your own?
Ah I think it’s just the way the question was phrased etc… I took a second to realise and I’ve been developing for 3 years now. It’s kinda like the ‘What do cows drink?” joke… or when someone shows you the word “Blue” which is red in colour and then asks you what colour it is… I very highly doubt anyone, even an absolute beginner wouldn’t have facepalmed themselves when they realised they got it wrong.
That doesn’t really explain why people defended their lack of knowledge so strongly though
I’d agree with John on this, I’ve always viewed these are fundamentals that you build upon. This behaviour can be useful and desired in writing efficient CSS, particularly when creating variants or stylistic overrides. I would assume lack of knowledge on how to leverage that behaviour is why these features are first to be on the chopping board every time.
The reason so many people got this wrong is because when you’re developing it often doesn’t really matter if you get this kind of thing wrong. What matters is the end result. Most people who want both to be blue in a real project that uses those classes are going to fiddle with the classes (or the style rules) until they get the result they want. Most people won’t care why they get it right. Thus, when it comes down to a quiz like this, they just do what their head tells them, which is usually the first thing they would try in a real project. So in a way, it’s a bit of an unfair quiz since there is no project in the universe that will only give you one crack at getting both divs blue.
And I don’t think it’s all that bad that people got this wrong, I think it’s just incidental to the fact that most developers are not concerned with concepts; they’re concerned with reaching an end goal (i.e. “just build stuff”).
This is fundamental basic CSS. I’ve taught at junior college level web dev for about 14 years, and this is the kind of thing they would teach in the first class or two.
I get that many people may forget this, or get caught on a trick like question. But combined a very, very basic education with a tiny amount of work experience would give you the correct answer.
So then, those that got it wrong… some people answer too quickly without thinking, some seriously just don’t know, and then the majority are probably just not very skilled/educated with CSS.
Pick any topic on the planet and setup a question like this and I think you would get similar results.
I think this could be chalked up to people’s knowledge of webdev technologies being based on a trial and error approach. They see tutorials or take an online course or watch a video, but ultimately your use case for a line of code may be different that what you learn so you must try something to see if it works. Not everyone is interested in the minute details of WHY something works the way it does, but that it works how they expect. I’ve been doing this 20 years and can tell you confidently that I did not get the right answer. does that make me bad at what I do? Should anyone who writes code be expected to know how that code gets compiled down to 1’s and 0’s to be considered good?
I also agree with John. I have been teaching the fundamentals of the web for 16 years now and developing for 20. I myself come from an Systems analyst Programmer background. I may be a little old school in this, however without a strong foundational knowledge getting the result that is required can be messy. Not saying that I discount what Louis has said in the comments about that it is the end result that matters.
My current students are amazed at the information I give them in regards to web technologies and how to implement them.
Being a Master of web technologies has devolved into a fracturing of the whole in regards to the job.
I also think that courisosity about how things work has been lost with the many tutorials that are available on the many different learning platforms out there. I have allways said that there are as many ways to skin a cat as there is to build a web site or application. Some are just more elegant than others due to knowledge and understanding people have.
The more important question is why didn’t the person who asked the question have a “none of the above” answer?
Unfortunately this attitude towards CSS is rampant an might be perpetuated by the typical FE developer interview – 19 questions about sorting algorithms and one about what the ‘C’ in CSS stands for.
The twitter question wasn’t about specificity, it was about order of appearance (https://www.w3.org/TR/css-cascade-3/#cascade).
I don’t know why a good deal of participants struggled to answer correctly, but it didn’t surprise me.
Modern approaches to CSS that are marketed as ‘best practices’ are actually not. For example, most approaches will allow a developer to hack HTML together that looks right and seems to work, but is actually broken. e.g.
<button class="class-for-link-elements">How to break the context menu for links and make them hard to find using a screen reader and voice control software.</button>.
…or they allow the developers so much control over the style, governance is impossible. That might not be important to some people today, but they’re unlikely to be writing maintainable HTML that can be styled differently for print, or different user needs, or reused for different customer brands, themed for festivals, etc..!
Is it really the case that these moderns approaches exist because CSS is just too powerful for mere mortals?