linkbait Linkbait 43 By www.quirksmode.org Published On :: Tue, 25 Jun 2019 14:39:49 +0100 Back from hiatus. I’m starting up serious planning and writing of “CSS for JavaScripters” so this is a CSS-heavy linkbait, mostly filled with reminders to myself. Every-layout.dev is easily the most important CSS resource to be unveiled in recent months. (In fact, it was unveiled at CSS Day, which was a nice touch.) Serious, in-depth, algorithmic discussion of several popular CSS layouts and how to construct them with care. The 2019 State of CSS survey results. Contains several interesting gems. The figure that really surprised me is that 85% of the respondents is male. I thought CSS had a slightly higher ratio of women. Then again, maybe it’s the marketing of the survey that caused the disparity. (I never heard of it until I saw the results.) Or my gender guesstimate is just wrong. The CSS mindset: [...] the declarative nature of CSS makes it particularly difficult to grasp, especially if you think about it in terms of a “traditional” programming language. Other programming languages often work in controlled environments, like servers. They expect certain conditions to be true at all times [...] CSS on the other hand works in a place that can never be fully controlled, so it has to be flexible by default. It’s less about “programming the appearance” and more about translating a design into a set of rules that communicate the intent behind it. Leave enough room, and the browser will do the heavy lifting for you. Interesting turn of phrase that echoes my own thoughts on the subject. Expect to find this in The Book. Excellent overview of render blocking in CSS and how to avoid it. It’s simple, really, but there will be countless CSS programmers who need this sort of tutorials. Will also go in The Book. An older article, but Harry Roberts’s Cyclomatic Complexity: Logic in CSS remains one cornerstone of CSS understanding, and teaching. This one is mostly meant to remind myself of its existence; you probably already read it. Facebook lost 20% of its usage (likes, shares, and such) since the Cambridge Analytica scandal broke. This sounds great in theory, but what if the people who are harder to dupe are the ones who stop using Facebook, while the more gullible people remain? The average Facebook user would become more stupid, and Facebook would become even better at influencing its users. Also, Facebook should be regulated. Not as a media company, but as a drug. We all know third-party scripts are among the worst offenders when it comes to website performance. But how bad is it actually, and who are the worst culprits? Third-party Web provides useful answers and treeviews. Excellent overview of WebViews, their purpose, their tricky bits, and their diversity. Required reading for all five people who care about the browser market. [In Dutch] List of websites closed on Sundays. In an ultimate meta-move this list is only available on Sundays. (And why are these websites closed? Because their proprietors subscribe to the strict Dutch Reformed view that Sundays are not for media enjoyment. See this article about the SGP political party for more background information.) You shouldn’t do thing with tool, you should do other thing Have a tip for the next Linkbait? Or a comment on this one? Let me know (or here or here). Full Article Linkbait
linkbait Linkbait 44 By www.quirksmode.org Published On :: Mon, 16 Mar 2020 13:36:31 +0100 Links in times of chaos. Laura Schenck, whose thoughts on programming CSS are very interesting anyway, discusses a project where she had to battle specificity. Key thought: Specificity breeds, much like conditionals breed in imperative languages [...]. Adding specificity is adding conditional logic. Once you start adding that logic, the code-base snowballs and it becomes difficult to understand, and thus difficult to maintain. She also asks if anyone who writes CSS should understand specificity to this degree. My answer is a firm Yes, just like you're expected to understand if- and for-loops when programming in any other language. Rachel Andrew ponders the pros and cons of CSS4. She is afraid that people will get confused by “CSS4” because several articles said there will never be a CSS4, and the version number 4 does not align with the version numbers of existing modules. Although both are true, I seriously doubt whether the people that “CSS4” is aimed at (those I call the torso and long tail of the CSS world) are aware or care. To me, this argument is overly legalistic, in the sense that it doesn’t matter in the real world. A much more important argument is that the announcement of “CSS4” will make people expect a list of new features that work in all browsers. In itself that’s great, and I think it would be really helpful, but the problem is that someone will have to decide what goes on the list and what does not — and the CSS WG is already stretched thin and cannot spare the time to do this. Maybe we need a community effort to help them? Worth thinking about. Interesting Twitter thread on why CSS is perceived as simultaneously very simple and very complicated. Because we think it's a simple language, we don't dive deep into it like we do with "real" programming languages. background: blue; makes the background turn blue, why should we bother diving in? But then it's time to build a layout and suddenly the combination of user agent styles and a lack of understanding in the fundamentals of CSS makes things break, or not behave how we expect them to. Yup. Mostly for myself: the difference between defer and async on script tags. Or, as Nicholas Zakas puts it: Do it now: <script src> Do it later: <script defer src> I don’t care when you do it, just not now: <script async src> Coil, the web monetization company, offers some interesting but too-much-under-the-radar thoughts on probabilistc revenue sharing. The idea is simple: if A, B, and C cooperate on a to-be-monetized article, and A is allotted 60% of the revenue, B 25% and C 15%, you simply add those probabilities to your payment pointers. Eventually a tool will draw a random and assign a specific payment to a specific author, but for now you can use a script to emulate that behaviour. Google proposes to sunset the User Agent string by freezing its version number and removing device information. The purpose here is to make fingerprinting (combining UA string, IP address, TCP/IP settings, device information and a host of other bits and pieces to accuratenly identify a web user) more difficult. The UA string will be replaced by client hints that give web developers some information about the browser, device, and platform. These hints will likely be more generic than the UA string, and thus hamper fingerprinting. The second problem with UA strings is the eternal arms race between clueless web developers and browser vendors, where web devs start using a certain badly-written browser detect, which forces browsers who want to end up on the good side of it to adjust their UA string, so that it gathers more and more cruft. (This is the reason every single browser string out there still starts with Mozilla.) I do not see this arms race go away. For instance, if the new Flow browser wants to defeat new browser detects written with client hints by clueless web developers, it will most likely be forced to announce itself as Chrome. Worse: we lose the ability to accurately identify it as Flow. As a result, new browser stats will make it appear as if Chrome is even more dominant than it actually is. Maybe we need another field Sec-CH-RealUA or something, where the browser can use its true name. On the other hand, that will be more fodder for clueless web developers and will perpetuate the arms race. In any case, to me it seems that more-or-less-accurate browser statistics will be the most important casualty of this switch. Related links (mostly for myself): client hints as currently implemented; discussion on a previous Safari attempt to do something similar; Blink intent to ship Mozilla and KaiOS Technologies are going to cooperate on future versions of KaiOS, the operating system for “smart feature phones” (read: cheap phones) that’s based on Firefox OS. Included in the article is a whole list of features Mozilla will work on, but they essentially boil down to keeping KaiOS updated for the ever-evolving web. Broadly speaking, these updates will mean many first-time internet users gain access to more of the web’s advanced digital services on devices that are affordable, reliable, and secure. Remember: KaiOS is aimed at not-so-rich people from emerging markets. As of May 2019 there were about 100 million devices out there. That’s piss poor compared to iOS and especially Android, but let’s see if their use explodes or not. Have a tip for the next Linkbait? Or a comment on this one? Let me know (or here or here). Full Article Linkbait