<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Elise Hein on Medium]]></title>
        <description><![CDATA[Stories by Elise Hein on Medium]]></description>
        <link>https://medium.com/@elisehein?source=rss-c69278bc3913------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*WJZS47Ny7FxmDnDSJ8ffDw.jpeg</url>
            <title>Stories by Elise Hein on Medium</title>
            <link>https://medium.com/@elisehein?source=rss-c69278bc3913------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Thu, 19 Nov 2026 02:41:55 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@elisehein/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Edges and intersections]]></title>
            <link>https://medium.com/design-bootcamp/edges-and-intersections-3f2d75103d8a?source=rss-c69278bc3913------2</link>
            <guid isPermaLink="false">https://medium.com/p/3f2d75103d8a</guid>
            <category><![CDATA[ui-design]]></category>
            <category><![CDATA[frontend]]></category>
            <category><![CDATA[design]]></category>
            <category><![CDATA[ui-engineering]]></category>
            <category><![CDATA[design-engineer]]></category>
            <dc:creator><![CDATA[Elise Hein]]></dc:creator>
            <pubDate>Thu, 08 May 2025 16:30:19 GMT</pubDate>
            <atom:updated>2025-05-08T21:32:00.346Z</atom:updated>
            <content:encoded><![CDATA[<h4>After more than a decade of working between design and development, this is a look at how I approach UI engineering, what drives me in the balancing act, and where along the spectrum I’ve landed, for now.</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*KQT57dtYZDmtfxQ7DgqbKA.png" /></figure><p>I love building for the web.</p><p>The fact that a single set of standards — HTML, CSS, and JavaScript — has been refined over decades to grow impressively more inclusive, to support so many new contexts, all while being entirely backwards compatible, is remarkable. A feature can take endless forms when it reaches the end user, and trying to work with that unpredictability, <a href="https://bigmedium.com/ideas/design-system-pace-layers-slow-fast.html">along the grain</a>, is what I like about my work.</p><p>This perspective is something I’ve grown into over time. Early in my career, I was more interested in ambitious prototypes and funky experiments (“look what I made!”) but these days I prefer using the platform as it was designed, leveraging its strengths. There’s often a straightforward, well-supported way to solve a problem, and I enjoy finding it. It rewards curiosity, precision, and care.</p><p>Allowing that curiosity to take the lead, I’ve spent the last decade working at the intersection of design and engineering. To make something resilient, accessible, and fast, you have to think in systems and care about details. And to shape those systems meaningfully, you have to understand users, flows, and interface patterns.</p><p>My official titles have leaned towards engineering, but much of my day-to-day work has lived near the edge of product design. At <a href="https://fora.health/">Fora Health</a>, working with vulnerable user groups taught me to notice the emotional impact of my design choices. Designing in problem spaces like clinical depression and dementia, I learned firsthand how even a single misplaced word can have a dramatic effect on how someone feels walking away from an interaction — a lesson in empathy that I’ve found applicable in every design problem I’ve faced since.</p><p>At <a href="https://griffin.com/">Griffin</a>, I led the design and development of a design system powering complex banking apps, marketing sites and internal tools. But in parallel, I continued designing on a higher level for product areas like 2FA, billing and payment operations. I was constantly zooming in and back out, across the <a href="https://bigmedium.com/ideas/design-system-pace-layers-slow-fast.html">pace layers of process</a>, from the outer orbits of innovation to the quality of individual interactions at the core.</p><p>Changing contexts like this daily helped shape my philosophy towards design engineering as a discipline. Providing teams with a shared UI language is only the baseline. At a higher level, I’ve come to see it as firmly rooted in <strong>empowerment</strong> and <strong>enablement</strong> — lowering the barrier to quality for everyone involved in building the product, through education, inclusion, and making the right thing the easiest thing to do.</p><p>Design systems are one tool — a robust UI library will scale quality. But alongside that, accurate developer documentation will foster adoption, higher-level design guidelines will create trust, working with product designers and PMs spurs innovation, and fixing papercuts will demonstrate care, while setting the bar high. As one founder explained his vision to me, it’s as much about guiding designers towards excellent code as it is about guiding other engineers towards UI excellence — and there is so much more to that than design system ownership.</p><p>In practice, this kind of work can take many forms. It could mean maintaining a <a href="https://sophieaguado.medium.com/articulating-design-decisions-0b81fbe030c6">record of design decisions</a>. Sometimes it’s providing an alternative declarative API in an otherwise compound component. Or <a href="https://www.smashingmagazine.com/2024/05/decision-trees-ui-components/">formatting design guidelines as flowcharts</a> to better support complex decision-making. Adding automated accessibility checks to the testing suite. <a href="https://papercuts.gitlab.com/">Publicly celebrating papercuts fixed</a>. Refining the build pipeline to better support theming. Other times it’s pairing with other engineers or joining RFC discussions to keep design infrastructure grounded in the realities of how teams actually work day to day. And calling it <em>infrastructure</em> matters — it’s not the layer on top, it’s what gets built with.</p><p>This kind of <a href="https://www.noidea.dog/glue">glue work</a> helps make quality the default outcome in teams without enough design-focused engineers to go around. And for a solo UI engineer in a mostly backend-leaning team — as I’ve found myself in many past roles — the need for this connective tissue ends up shaping much of the work.</p><p>But I still get enormous pleasure from the craft itself, and I’ve missed working closely with likeminded engineers who enjoy refining the details that make a UI feel solid. I’ve recently been going through a preview of <a href="https://rauno.me/">Rauno Freiberg’s</a> upcoming <a href="https://devouringdetails.com/">Devouring Details</a> interaction design course, and it’s been a welcome reminder of how much joy there is in chasing quality at the level of individual interactions — not just for the polish, but for the confidence this instils that the same quality is also present in the parts of the product that the user <em>can’t</em> see.</p><p>Paco Coursey <a href="https://ui.land/interviews/paco-coursey#what-are-you-currently-excited-about?">captures</a> it perfectly:</p><blockquote><em>Animate those icons. Brand that scrollbar. Polish that </em><em>:active state. Load a single typeface glyph to render the world’s best ampersand. Make it fast. Make it accessible. Add keyboard shortcuts. Add tooltips. Animate the transition between two open tooltips. Manually measure text and avoid line wrapping widows. Design favicons that reflect app state. Convert internal URLs to rich previews. […] Design a whole new stylesheet for printing. Design a whole new page for mobile. Dynamically generate video thumbnails and use them in a custom video player. Optimize your re-renders.</em></blockquote><p>It’s the sort of work where aesthetics, accessibility, motion, and psychology meet frontend performance and CSS craft, and where I slip into flow most easily.</p><p>Working with thoughtful, principled engineers and talented designers over the years, I’ve picked up enough from both to navigate the intersection, acting as glue when needed. The pull between disciplines often feels like a tension — a choice on which edge of the split I want to fall on. But the balancing act itself is also what keeps me attentive, and the work rewarding.</p><p>I’m taking this mindset to my next role at <a href="https://plain.com/">Plain</a>, and I’m curious to see how the lines continue shifting in a new context — especially now, as AI is redefining in real time how we design and build for the web. Methods change, but the results will depend on the same core principles. There’s plenty still to work out!</p><p><em>Originally published on </em><a href="https://elisehe.in/2025/05/08/edges-and-intersections"><em>https://elisehe.in</em></a><em> on May 8th, 2025.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=3f2d75103d8a" width="1" height="1" alt=""><hr><p><a href="https://medium.com/design-bootcamp/edges-and-intersections-3f2d75103d8a">Edges and intersections</a> was originally published in <a href="https://medium.com/design-bootcamp">Bootcamp</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Fighting Inter-Component HTML Bloat]]></title>
            <link>https://javascript.plainenglish.io/fighting-inter-component-html-bloat-4eed7ff0bd06?source=rss-c69278bc3913------2</link>
            <guid isPermaLink="false">https://medium.com/p/4eed7ff0bd06</guid>
            <category><![CDATA[design-systems]]></category>
            <category><![CDATA[html]]></category>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[accessibility]]></category>
            <category><![CDATA[react]]></category>
            <dc:creator><![CDATA[Elise Hein]]></dc:creator>
            <pubDate>Mon, 27 Nov 2023 04:17:14 GMT</pubDate>
            <atom:updated>2024-02-16T12:13:04.784Z</atom:updated>
            <content:encoded><![CDATA[<h4>The separation of concerns we aim for in design systems has an unwanted byproduct: bloated HTML in the space between components. What can we do as component authors to encourage good markup hygiene at the inter-component level?</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*6wfUSDIcd6nehcgW" /><figcaption>Photo by <a href="https://unsplash.com/@cgower?utm_source=medium&amp;utm_medium=referral">Christopher Gower</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>When we decide what qualifies as a component in a component library or design system, we aim for a separation of concerns: we decouple something that creates whitespace from something that creates frames from something that styles type so that each can be reused in different contexts. But when each UI characteristic is represented by its own DOM tree, this decoupling can — by design — result in HTML bloat.</p><p>Let’s look at where this comes from, why redundant HTML should be avoided in the first place, and how to do so without sacrificing the neat separation of concerns that helps to create the shared language between design and development.</p><p><em>Note: The examples in this post will be React-specific, but the core idea extends to most JS-based component libraries. In JavaScript-based component libraries, the “vessel” for a single component is a HTML node or tree of nodes (what </em><em>&lt;MyComponent&gt; in libraries like React or Vue, or </em><em>&lt;my-component&gt; in native web components ultimately end up as.) Contrast this to CSS-based libraries such as Salesforce’s </em><a href="https://www.lightningdesignsystem.com/guidelines/markup-and-style/"><em>Lightning</em></a><em> where the consumer is responsible for attaching predefined classes to their own HTML structure. HTML bloat as a biproduct occurs mostly in the former.</em></p><p>Consider a Card component with a title and optional description:</p><pre>&lt;Card&gt;<br>  &lt;Stack spacing=&quot;medium&quot;&gt;<br>    &lt;Heading&gt;Card title&lt;/Heading&gt;<br><br>    {description &amp;&amp;<br>      &lt;Text&gt;{description}&lt;/Text&gt;}<br>  &lt;/Stack&gt;<br>&lt;/Card&gt;</pre><p>From the component library design point of view, this makes sense:</p><ul><li>Card is responsible for visually framing the component.</li><li>Stack is responsible for the spacing between the heading and description.</li></ul><p>Let’s look at the HTML this produces. A simplified version might be something like this:</p><pre>&lt;style type=&quot;text/css&quot;&gt;<br>  .card {<br>    border: 1px solid silver;<br>  }<br><br>  .stack {<br>    display: flex;<br>    flex-direction: column;<br>    gap: 1rem;<br>  }<br>&lt;/style&gt;<br><br>&lt;div class=&quot;card&quot;&gt;<br>  &lt;div class=&quot;stack&quot;&gt;<br>    &lt;h2&gt;Card title&lt;/h2&gt;<br>    &lt;p&gt;Description&lt;/p&gt;<br>  &lt;/div&gt;<br>&lt;/div&gt;</pre><p>Strictly speaking, you don’t need two wrapper divs to achieve the intended look. If you&#39;d never been “tainted” with the design system mindset and instead built this bit of UI using plain HTML and CSS, I&#39;d be willing to bet you&#39;d instinctively combine the styles for the card frame and spacing between children into a single class. The card description could be included or omitted without any impact on the markup:</p><pre>&lt;style type=&quot;text/css&quot;&gt;<br>  .card {<br>    display: flex;<br>    flex-direction: column;<br>    gap: 1rem;<br>    border: 1px solid silver;<br>  }<br>&lt;/style&gt;<br><br>&lt;div class=&quot;card&quot;&gt;<br>  &lt;h2&gt;Card title&lt;/h2&gt;<br>  &lt;p&gt;Description&lt;/p&gt;<br>&lt;/div&gt;<br><br>&lt;div class=&quot;card&quot;&gt;<br>  &lt;h1&gt;Card title&lt;/h1&gt;<br>&lt;/div&gt;</pre><p>We have lost the redundant wrapper. But we have also lost the neatly separated areas of responsibility for the card frame and element spacing. The importance of neither should be overlooked, but satisfying both requires us to be deliberate in how we design our component APIs.</p><p>When you&#39;re the one authoring a component, you have a level of control over the markup and styling that lets you keep bloat to a minimum. The onus cannot be on the <em>consumer</em> of your library to make these same optimisations at the inter-component level, because they probably won&#39;t. Why not?</p><ul><li>Semantics and accessibility are usually handled for you in design system components, so it can be easy to forget that this doesn&#39;t extend to page-level (inter-component) code.</li><li>While minimising markup bloat isn&#39;t particularly tricky, it can result in a fair amount of boilerplate.</li></ul><p>Creating context-aware components in a way that consumers can ignore inter-component markup altogether is unrealistic. For now, we cannot bundle good page-level markup hygiene free into our design systems, but we should at the least make working towards it convenient.</p><p>I&#39;d like to cover a few ways that component APIs can be extended to make the underlying markup more flexible. But before that, a sidebar on why bloated HTML should sound alarm bells in the first place. Should we be worried about div soup at all in 2023?</p><h3>Why avoid extra wrapper elements?</h3><h4>1. Bloated HTML hurts performance</h4><p>Redundant wrapper elements are a form of bloated HTML, and bloated HTML can <a href="https://developer.chrome.com/en/docs/lighthouse/performance/dom-size/">hurt performance</a>, both during page load (resource size) and runtime (costly layout reflows and element querying).</p><p>We obsessively optimise when it comes to scripts, styles, and other resources; interestingly, that doesn’t always apply to HTML. In the case of single-page apps, it may feel like you stand to gain more in performance if you focus on JavaScript. In the case of server-rendered, non-interactive sites, <a href="https://blog.jim-nielsen.com/2021/thoughts-on-avoiding-an-excessive-dom-size/">some people doubt</a> that the performance impact of a large DOM is noticeable.</p><p>We also lack the required tooling: according to Jens Meiert, not enough HTML minifiers <a href="https://meiert.com/en/blog/html-performance/">prune optional HTML tags and default attributes</a> (Note that “optional” here refers not to extra wrappers, but to tags that are <a href="https://meiert.com/en/blog/optional-html/">optional syntactically</a>). When it comes specifically to unneeded wrapper elements, tooling wouldn’t help us anyway (you would need a pretty sophisticated analysis of the associated styling to determine if an element can really be omitted).</p><h4>2. Redundant elements can cause accessibility problems</h4><p>Our markup needs to be semantic; an extra div here and there doesn’t take anything away from that. But a misplaced extra element can make your carefully selected semantic tags useless.</p><p>This happens mainly with elements that have strict rules about containment or placement. For example:</p><ul><li>A legend must appear as the first child of fieldset.</li><li>A figcaption must appear as the first or last child of figure.</li><li>A li must appear as a direct child of either ul, ol or menu.</li><li>dt and dd must both appear as direct children of dl or a div inside dl.</li></ul><p>Design system components with a strict separation of concerns can easily break this:</p><pre>&lt;ul&gt;<br>  &lt;Columns&gt;<br>    &lt;Column&gt;<br>      &lt;li/&gt;<br>    &lt;/Column&gt;<br>    &lt;Column&gt;<br>      &lt;li/&gt;<br>    &lt;/Column&gt;<br>    &lt;Column&gt;<br>      &lt;li/&gt;<br>    &lt;/Column&gt;<br>  &lt;/Columns&gt;<br>&lt;/ul&gt;</pre><p>(Speaking specifically of React, sometimes these situations arise because a component rendering multiple children must wrap them in a single parent node; <a href="https://reactjs.org/docs/fragments.html#motivation">fragments</a> were added precisely to keep HTML valid when this happens.)</p><p>Out of the top 100 most visited websites, <a href="https://meiert.com/en/blog/valid-html-2022/">not a single one used valid HTML in 2022</a>. Misplaced wrappers may play only a small role in this, but if we can author design system components that make it easier to avoid, we should.</p><h4>3. Redundant elements can break styling</h4><p>Just as the extra element is sometimes legitimately needed for specific styling needs, in other situations it can break your layout. When using CSS flexbox and grid, each element in the flex or grid layout must be a direct child of the parent with display: grid or display: flex.</p><h4>4. Deeply nested DOM trees are annoying to work with</h4><p>Finally, working with deeply nested DOM trees just slows you down.</p><p>When making sense of a bit of HTML, I scan it for landmarks and other elements that hint at the structure of the content. This becomes harder to do if the number of meaningful elements is eclipsed by those that are meaningless. Debugging becomes harder, tracking down nodes in the inspector becomes more tedious, and the joy of the craft is diminished.</p><h3>Making component markup flexible</h3><p>Here’s a non-complete list of techniques I use to make the underlying markup in my components more flexible. Many of these primarily serve some other need but come with the bonus of reducing redundant wrappers.</p><h4>1. Always accept inline styles and classes</h4><p>Component libraries often come with Box and other generic container components. These primitives are encouraged, among other use cases, when you need custom styling.</p><p>Why not just use a div? In some design systems, this comes down to the use of CSS-in-JS and/or theming libraries: going via Box or an equivalent primitive usually comes with direct access to the design system&#39;s tokens. If the source of truth for your tokens is in JavaScript, a div styled with plain old CSS just won&#39;t cut it. Neither will tacking a class or inline styles onto an existing component.</p><p>(See, for example, the css prop in <a href="https://stitches.dev/docs/overriding-styles#the-css-prop">Stitches</a>, the sx prop in <a href="https://theme-ui.com/sx-prop">Theme UI</a>, a more constrained style prop in <a href="https://nulogy.design/guides/style-props/">Nulogy</a>. Other design systems expose an individual prop per styling property, for example, <a href="https://paste.twilio.design/primitives/box">Paste</a> or <a href="https://seek-oss.github.io/braid-design-system/components/Box#css-utilities">Braid</a>.)</p><p>Box is a great primitive to expose, but should not be seen as the sole tool for style overrides. When a component disallows style overrides or limits them to a subset of CSS properties, you end up with a tree of boxes when your styling adjustments could easily have been made on the nodes already present in the DOM.</p><pre>{/* Rigid style overrides */}<br>&lt;Box<br>  borderRadius=&quot;borderRadius20&quot;<br>  borderStyle=&quot;solid&quot;<br>  borderWidth=&quot;borderWidth10&quot;<br>  borderColor=&quot;colorBorderPrimaryWeak&quot;<br>&gt;<br>  &lt;FancyComponentWithoutABorder&gt;<br>    &lt;Heading&gt;<br>      &lt;Box fontWeight=&quot;bold&quot;&gt;Heading&lt;/Box&gt;<br>    &lt;/Heading&gt;<br>  &lt;/FancyComponentWithoutABorder&gt;<br>&lt;/Box&gt;<br><br>{/* Flexible style overrides */}<br>&lt;FancyComponentWithoutABorder<br>  borderRadius=&quot;borderRadius20&quot;<br>  borderStyle=&quot;solid&quot;<br>  borderWidth=&quot;borderWidth10&quot;<br>  borderColor=&quot;colorBorderPrimaryWeak&quot;&gt;<br>  &lt;Heading fontWeight=&quot;bold&quot;&gt;Heading&lt;/Heading&gt;<br>&lt;/FancyComponentWithoutABorder&gt;</pre><p>So — whether you’re limited in the use of vanilla CSS because of design tokens or you just want to formalise <em>how</em> styles are overridden, make sure you expose <em>a</em> way of doing so on every component. If people need to adjust component styling, they will. You may as well make targeting the right node as easy as possible.</p><h4>2. Make the root node tag customisable</h4><p>Overriding the root node tag of a component is usually exposed via an as prop like so: &lt;Box as=&quot;header&quot;&gt;.</p><p>It’s uncommon for the as prop or equivalent <em>not</em> to be provided these days. Just to explain its importance, here&#39;s one way you end up with extra DOM nodes when you&#39;re not allowed to modify the rendered HTML element. Say you want to render a list of cards:</p><pre>&lt;Stack spacing=&quot;small&quot;&gt;<br>  &lt;ul&gt;<br>    &lt;li&gt;<br>      &lt;Card&gt;&lt;/Card&gt;<br>    &lt;/li&gt;<br>    &lt;li&gt;<br>      &lt;Card&gt;&lt;/Card&gt;<br>    &lt;/li&gt;<br>    &lt;li&gt;<br>      &lt;Card&gt;&lt;/Card&gt;<br>    &lt;/li&gt;<br>  &lt;/ul&gt;<br>&lt;/Stack&gt;</pre><p>Using as, this could be rewritten as follows:</p><pre>&lt;Stack as=&quot;ul&quot; spacing=&quot;small&quot;&gt;<br>  &lt;Card as=&quot;li&quot; /&gt;<br>  &lt;Card as=&quot;li&quot; /&gt;<br>  &lt;Card as=&quot;li&quot; /&gt;<br>&lt;/Stack&gt;</pre><p>Even worse than a component that doesn’t provide an as prop is one that doesn&#39;t provide an as prop <em>and</em> renders something other than a generic div. A good example is something like Heading. It may be tempting to enforce one of h1–h6 elements under the hood. But (as much as you discourage it in your documentation) that would be making the assumption that your Heading component will never be used to show arbitrary text that just needs to look prominent.</p><h4>3. Consider if your component needs to output a node</h4><p>Similarly to as, I would like to see much more of asChild or an equivalent in the wild.</p><p>Popularised by <a href="https://www.radix-ui.com/docs/primitives/overview/styling#changing-the-rendered-element">Radix UI</a>, asChild is a way to merge a single-node component&#39;s props onto its own single child node. The node itself will be omitted, but its props and functionality will be copied into its child. This works great in highly composable components, or when one component provides behaviour while the other provides styling, as illustrated by Radix UI&#39;s own examples:</p><pre>import * as React from &quot;react&quot;;<br>import * as Dialog from &quot;@radix-ui/react-dialog&quot;;<br>import { MyButton } from &quot;./my-button&quot;;<br><br>export default () =&gt; {<br>  return (<br>    &lt;Dialog.Root&gt;<br>      &lt;Dialog.Trigger asChild&gt;<br>        &lt;MyButton&gt;Open dialog&lt;/MyButton&gt;<br>      &lt;/Dialog.Trigger&gt;<br>      &lt;Dialog.Content&gt;...&lt;/Dialog.Content&gt;<br>    &lt;/Dialog.Root&gt;<br>  );<br>};</pre><p>DialogTrigger might by default return a &lt;button&gt;, but we want to use our own MyButton as the trigger instead. Without asChild, we may end up with &lt;button&gt;&lt;button&gt;&lt;/button&gt;&lt;/button&gt;, where the extra element is both invalid and unnecessary. With asChild, the output is a single &lt;button/&gt; with styling from &lt;MyButton&gt; and dialog trigger semantics from &lt;Dialog.Trigger&gt;.</p><p>Support for asChild is especially critical in libraries that provide highly composable components (of which Radix UI is a great example). Compound components <a href="https://epicreact.dev/soul-crushing-components/">come with a range of benefits</a>, but they are also more prone to outputting bloated HTML unless you specifically build in safeguards to avoid it.</p><p>If you want to build in asChild support into your own components, Radix UI provides the nifty <a href="https://www.radix-ui.com/docs/primitives/utilities/slot">Slot</a> utility to handle merging of event handlers and other props for you.</p><p>In more specialised components, it may not always be appropriate to support a full merge of props à la asChild. But the basic idea still stands: just because we use a HTML-like entity as the vessel for a component doesn&#39;t mean it needs to output an actual HTML node. Some examples:</p><ul><li>passHref in <a href="https://nextjs.org/docs/api-reference/next/link#if-the-child-is-a-custom-component-that-wraps-an-a-tag">Link from Next.js</a>: &lt;Link href=&quot;/foo&quot; passHref&gt;&lt;Text&gt;Link&lt;/Text&gt;&lt;/Link&gt; outputs a single &lt;a&gt; tag.</li><li>Enhancing the behaviour of child nodes: If a component is responsible purely for attaching attributes to its <em>child</em> node, why introduce a wrapper? A good example is the VisuallyHidden component, which usually just <a href="https://github.com/radix-ui/primitives/blob/main/packages/react/visually-hidden/src/VisuallyHidden.tsx">adds a set of inline styles</a> to its content. If its content consists of multiple sibling nodes, the wrapper is justified. But if it wraps a single element, the set of styles can just as well be attached to that one element, and the wrapper omitted.</li><li>Wrappers that operate on multiple children: If a wrapper node only has an effect when it has more than one child, why not double-check the number of children before applying that effect? Standard components such as Stack or Inline are great examples of this, because they&#39;re responsible for laying out multiple children along an axis. Single child → no gaps or axes to work with → why the wrapper? <a href="https://elisehe.in/2023/03/27/minimal-html-in-design-systems#mn:omitforsinglechild">8</a></li></ul><h4>4. Make your Stacks smarter</h4><p>This one is a bit special, as it concerns a specific component: the ubiquitous Stack (Stack, Inline or Flex, depending on the implementation).</p><p>Let’s go back to the Card example from the start of this post and extend it to support a subtitle:</p><pre>&lt;Card&gt;<br>  &lt;Stack spacing=&quot;medium&quot;&gt;<br>    &lt;Heading level={2}&gt;Card title&lt;/Heading&gt;<br>    {subtitle &amp;&amp;<br>        &lt;Heading level={3}&gt;{subtitle}&lt;/Heading&gt;}<br><br>    {description &amp;&amp;<br>      &lt;Text&gt;{description}&lt;/Text&gt;}<br>  &lt;/Stack&gt;<br>&lt;/Card&gt;</pre><p>The optional subtitle happens to sit closer to the title than it does to the description, which makes the wrapper Stack with medium spacing insufficient. Along comes a second Stack, this time with small spacing:</p><pre>&lt;Card&gt;<br>  &lt;Stack spacing=&quot;medium&quot;&gt;<br>    &lt;Stack spacing=&quot;small&quot;&gt;<br>      &lt;Heading level={2}&gt;Card title&lt;/Heading&gt;<br>      {subtitle &amp;&amp;<br>          &lt;Heading level={3}&gt;{subtitle}&lt;/Heading&gt;}<br>    &lt;/Stack&gt;<br><br>    {description &amp;&amp;<br>      &lt;Text&gt;{description}&lt;/Text&gt;}<br>  &lt;/Stack&gt;<br>&lt;/Card&gt;</pre><p>We are well on our way into div soup territory.</p><p>Why can’t stack-like components support variable spacing between children? Neither flex nor grid layouts currently support variable gaps, so at the moment the implementation for something like this would necessarily rely on margin on each child rather than gap on the wrapper.</p><p>This would violate a core tenet of design systems — that elements should never be responsible for layout outside of their own bounds.</p><p>I think this violation is justified. Unless you’re working with straight-up lists of repeated elements, it’s uncommon for a well-designed UI to feature more than 2–3 consecutive elements with equal spacing anyway. The result is deeply nested stacks upon stacks upon stacks when really we should be dealing with a flat list of siblings — unnecessary wrappers at their most obvious.</p><p>I encourage supporting something like &lt;Stack spacing={[&quot;small&quot;, &quot;small&quot;, &quot;medium&quot;]}&gt; alongside the standard &lt;Stack spacing=&quot;medium&quot;&gt;. Because stack-like components are so ubiquitous, the impact on redundant HTML will be noticeable.</p><h4>5. Raise awareness in documentatin</h4><p>Markup manipulation should be normalised in your documentation.</p><p>As mentioned, the as prop is quite a common feature in component libraries, but it&#39;s fair to assume it&#39;s not used as often as it could be. Based on the <a href="https://almanac.httparchive.org/en/2020/markup#element-diversity">analysis of 7.5 million webpages in 2020</a>, element diversity was poor: out of the 112 available elements in HTML, the 90th percentile website only used 42. The most popular HTML element in 2020 continued to be div.</p><p>Could insufficient documentation and awareness be one of the causes?</p><p>I’d argue that it’s rare to achieve great markup hygiene at the page level without frequent use of one of the described techniques (style overrides and the as prop being the most critical). As such, their use should be illustrated in all documented code examples to make them more realistic.</p><p>Instead of illustrating the use of the Columns component with a bare-bones example like this:</p><pre>&lt;Columns&gt;<br>  &lt;Column&gt;A column&lt;/Column&gt;<br>  &lt;Column&gt;A column&lt;/Column&gt;<br>&lt;/Columns&gt;</pre><p>…consider adding (at least somewhat) realistic semantics into your code snippets:</p><pre>&lt;Columns style={ { height: &quot;100vh&quot; } }&gt;<br>  &lt;Column as=&quot;nav&quot;&gt;Navigation&lt;/Column&gt;<br>  &lt;Column as=&quot;main&quot;&gt;Main content&lt;/Column&gt;<br>&lt;/Columns&gt;</pre><p>It also helps to mention the default root HTML element that a component outputs in its description (someone consuming your docs will be forced to take the extra second to consider whether that element needs overriding).</p><p>Finally, it goes without saying that it helps to frequently <em>look</em> at and analyse the HTML your components produce. Storybook addons like <a href="https://storybook.js.org/addons/@whitespace/storybook-addon-html">HTML preview</a> and <a href="https://storybook.js.org/addons/@storybook/addon-a11y">Accessibility</a> are as much (or more) about raising awareness as they are about functionality.</p><p>When viewed in the context of a single component, redundant HTML can seem inconsequential. And given the current zeitgeist around AI, obsessing about an extra div may feel a bit 🤡</p><p>But when viewed collectively and across products, the importance of lean markup is compounded. In her article, <a href="https://amyhupe.co.uk/articles/building-conscious-design-systems/"><em>Building conscious design systems</em></a>, Amy Hupe wrote:</p><blockquote><em>If we can use our design systems to speed up meaningful work, standardise things to a high quality, and scale the things we actually want to reproduce — then the reverse is also true. It means that we can also use our design systems to speed up problematic work, standardise things to a poor quality, and scale things we don’t want to reproduce.</em></blockquote><p>Bloat scales. Let’s make it easier for component consumers to avoid it.</p><p>Originally published on <a href="https://elisehe.in/2023/03/27/minimal-html-in-design-systems">elisehe.in</a> on March 27th, 2023.</p><h3><a href="https://plainenglish.io/">PlainEnglish.io</a> 🚀</h3><p><em>Thank you for being a part of the In Plain English community! Before you go:</em></p><ul><li><em>Be sure to </em><strong><em>clap</em></strong><em> and </em><strong><em>follow</em></strong><em> the writer</em><strong>️</strong></li><li><em>Learn how you can also </em><a href="https://plainenglish.io/blog/how-to-write-for-in-plain-english"><strong><em>write for In Plain English</em></strong></a><em>️</em></li><li><em>Follow us: </em><a href="https://twitter.com/inPlainEngHQ"><strong><em>X</em></strong></a><strong><em> | </em></strong><a href="https://www.linkedin.com/company/inplainenglish/"><strong><em>LinkedIn</em></strong></a><strong><em> | </em></strong><a href="https://www.youtube.com/channel/UCtipWUghju290NWcn8jhyAw"><strong><em>YouTube</em></strong></a><strong><em> | </em></strong><a href="https://discord.gg/in-plain-english-709094664682340443"><strong><em>Discord</em></strong></a><strong><em> | </em></strong><a href="https://newsletter.plainenglish.io/"><strong><em>Newsletter</em></strong></a></li><li><em>Visit our other platforms: </em><a href="https://stackademic.com/"><strong><em>Stackademic</em></strong></a><strong><em> | </em></strong><a href="https://cofeed.app/"><strong><em>CoFeed</em></strong></a><strong><em> | </em></strong><a href="https://venturemagazine.net/"><strong><em>Venture</em></strong></a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=4eed7ff0bd06" width="1" height="1" alt=""><hr><p><a href="https://javascript.plainenglish.io/fighting-inter-component-html-bloat-4eed7ff0bd06">Fighting Inter-Component HTML Bloat</a> was originally published in <a href="https://javascript.plainenglish.io/">JavaScript in Plain English</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[The wasted potential of attribute selectors in CSS]]></title>
            <link>https://elisehein.medium.com/the-wasted-potential-of-attribute-selectors-in-css-49102cb88f34?source=rss-c69278bc3913------2</link>
            <guid isPermaLink="false">https://medium.com/p/49102cb88f34</guid>
            <category><![CDATA[css]]></category>
            <category><![CDATA[design-systems]]></category>
            <category><![CDATA[html]]></category>
            <category><![CDATA[accessibility]]></category>
            <dc:creator><![CDATA[Elise Hein]]></dc:creator>
            <pubDate>Sun, 16 Oct 2022 14:51:56 GMT</pubDate>
            <atom:updated>2022-10-18T09:47:15.709Z</atom:updated>
            <content:encoded><![CDATA[<p>I’m a long-time <a href="https://getbem.com/introduction/">BEM</a> user. The double underscore creeps into my code even when selector collision isn’t an issue. I don’t think it’s BEM, specifically, that I’m drawn to (it just happened to be the methodology I first learned about and grew used to). It’s the fact that a methodology, any methodology, adds structure and semantics to HTML class naming where inherently there isn’t one.</p><p>It’s why I always feel a bit lost when using CSS modules or CSS-in-JS libraries. What do you <em>mean</em> I can name my classes or styled components whatever I want? It’s not unheard of for people to <a href="https://medium.com/trabe/using-bem-conventions-in-css-modules-leveraging-custom-webpack-loaders-fd985f72bcb2">use BEM <em>with </em>CSS modules</a>. This might seem silly — they solve the same problem, after all. But perhaps it shows that rigid class naming conventions are attractive beyond their power to avoid collisions. For better or worse, they allow us to gauge the role of each selector from the stylesheet alone.</p><p>In our preoccupation with classes, it’s easy to think of them as the default selector. Historically, when people have talked about targeting elements by their attributes, it’s been in the context of neat tricks or one liners. You make a mental note to use a[href^=https://specific-domain.com] the next time you want to use pink underlines for each link to one specific domain, and promptly forget about it forever. Or, to give a more practical example, attribute selectors <a href="https://willmendesneto.com/posts/linting-web-accessibility-issues-in-your-html-using-just-css/">have been recommended</a> as a kind of linter or debugger for invalid HTML (img:not([alt]) { border: 1rem solid red; }).</p><p>More recently, the idea to treat attribute selectors on par with classes as first-class citizens has been proposed more widely. We’re no longer talking about edge cases, but challenging the very defaultness of classes, all while not giving up that sense of structure that many of us look for in CSS naming conventions.</p><p>The two articles that have stood out for me are:</p><ul><li><a href="https://www.aleksandrhovhannisyan.com/blog/represent-state-with-html-attributes-not-class-names/"><em>Represent state with HTML attributes not class names</em> </a>by Aleksandr Hovhannisyan</li><li><a href="https://www.keithcirkel.co.uk/css-classes-considered-harmful/"><em>CSS classes considered harmful</em></a><em> </em>by Keith Cirkel</li></ul><p>Aleksandr and Keith both advocate for attribute selectors instead of class names, but while Aleksandr describes the more conservative approach of preferring attribute selectors <em>where one already exists on the HTML element</em>, Keith goes a step further and proposes adding your own data-* attribute instead of another class name when you need something to hook into.</p><p>Let’s look at both more closely.</p><h4>Representing native state</h4><p>Aleksandr Hovhannisyan makes the case that classes are too often used to style different states or variants of an element, where that state might — or, critically, <em>should — </em>already be semantically represented by other properties such as ARIA attributes or pseudo selectors.</p><p>No-one objects that you should prefer input[disabled] over input.is-disabled, because most of the time it’s unnecessary to add that class name manually when you already have an attribute selector to hook into. We tend to forget that there are plenty of other native ways to represent state that we should be using anyway — namely ARIA attributes. (Though we don’t get them for free as we do with pseudo classes like :hover, :checked or :focus.)</p><p>Compare the following. Using modifier classes:</p><pre>&lt;a href=”/page2/” class=”nav-link nav-link--is-active”&gt;Page 2&lt;/a&gt;</pre><pre>.nav-link.nav-link--is-active { }</pre><p>Using ARIA attributes:</p><pre>&lt;a href=”/page2/” class=”nav-link” aria-current=”page”&gt;Page 2&lt;/a&gt;</pre><pre>.nav-link[aria-current=&quot;page&quot;] { }</pre><p>The crucial point here is that aria-current=&quot;page&quot; should be included regardless of the styling needs of an active link<em>, </em>and I can’t think of a reason why we should ever add an extra class where the state can already be selected for in a different way. Worst case scenario, this would mean you’re implementing state management twice.</p><p>This promotes an a11y-first mindset — if there is no attribute or pseudo selector available to represent the state we wish to style, should we add one? Are we using the right HTML element? We are forced to go through a mental flow chart of native, semantic HTML and CSS features we could tap into before resorting to classes.</p><p>I’m reminded of Testing Library’s <a href="https://testing-library.com/docs/queries/bytestid/">guiding principle</a> to only ever reach for the testId element selector when you’ve ruled out all other, more semantic querying options. What if we treated classes a bit like test IDs, appreciating them as a robust, generic fallback option that we can reach for when there are no other appropriate, semantic attributes available on the element?</p><p>Other people have covered thoroughly the many examples of using ARIA attributes and other semantic selectors for styling, so I won’t cover any more here. Do have a read if you’re interested:</p><ul><li><a href="https://benmyers.dev/blog/semantic-selectors/"><em>Style with stateful, semantic selectors</em></a> by Ben Meyers</li><li><a href="https://css-tricks.com/user-facing-state/"><em>User facing state</em></a> by Scott O’Hara</li><li><a href="https://adrianroselli.com/2021/06/using-css-to-enforce-accessibility.html"><em>Using CSS to enforce accessibility</em></a> by Adrian Roselli</li></ul><h4>Representing custom state</h4><p>Aleksandr Hovhannisyan explains well how the use of attribute selectors can result in better UX. I find it a satisfying coincidence that Keith Cirkel reaches the same conclusions coming from a place of <em>developer</em> experience. He highlights the DX issue with classes:</p><blockquote>Classes, being a list of arbitrary strings, have no key-values, no private state, no complex types (which also means IDE support is quite limited) and rely on custom DSLs like BEM just to make them slightly more usable. We keep trying to implement parameters into a Set&lt;string&gt; when what we want is a Map&lt;string, T&gt;. (<a href="https://www.keithcirkel.co.uk/css-classes-considered-harmful/">Keith Cirkel</a>)</blockquote><p>There’s a well-known fundamental principle in software engineering: <a href="https://kentcdodds.com/blog/make-impossible-states-impossible"><strong>Make impossible states impossible</strong></a>. (As a side note, I highly recommend the article and linked talk. This may be the principle I rely on the most when authoring code, and the main reason why I lament the lack of native enums in JavaScript.)</p><p>My impression from Keith’s article is that, at its core, <em>this</em> is the principle that class selectors violate. An element’s classes are never guaranteed to reflect their state (nothing prevents you from adding the class button--loading to a button that isn’t, in fact, loading), and classes that are used to represent one of many mutually exclusive variants are never guaranteed to be mutually exclusive (nothing prevents you from adding button--primary <em>and</em> button--secondary to the same button).</p><p>I love how Keith frames this as a type issue. As an example, we can look at the naming of some of <a href="https://tailwindcss.com/docs/responsive-design">Tailwind’s utility classes</a>: using a colon to group related sets of classes could be taken as an attempt to signal mutual exclusivity. &lt;div class=&quot;sm:w-80 sm:w-96&quot;&gt; should sound the alarm bells because the offending logic is immediately visible in the naming.</p><p>Keith reminds us that attribute selectors can be some of the most versatile in our CSS toolbelt — data-* attributes, combined with the <a href="https://developer.mozilla.org/en-US/docs/Web/CSS/Attribute_selectors">rich variation in CSS attribute selectors</a>, could be used to capture strings as well as lists — and he encourages us to embrace them. Here lies the difference between his and Aleksandr’s suggestions: it’s not about merely using the native attributes already present on the element, it’s about adding custom ones — instead of classes — when they’re not.</p><p>An example from Keith’s article:</p><pre>.Card { /* ... */ }<br>.Card[data-size=big] { width: 100%; }<br>.Card[data-size=medium] { width: 50%; }<br>.Card[data-size=small] { width: 25%; }<br><br>.Card[data-align=left] { text-align: left; }<br>.Card[data-align=right] { text-align: right; }<br>.Card[data-align=center] { text-align: center; }</pre><pre>.Card[data-border-collapse~=&quot;top&quot;] { border-top: 0 }<br>.Card[data-border-collapse~=&quot;right&quot;] { border-right: 0 }<br>.Card[data-border-collapse~=&quot;bottom&quot;] { border-bottom: 0 }<br>.Card[data-border-collapse~=&quot;left&quot;] { border-left: 0 }</pre><p>It’s much easier to avoid impossible states when you have different “slots” to fill in with the different groups of variants for your element, rather than shoving all of them in a single cobbled up string in class, however disciplined your naming may be.</p><p>And there’s a reason why &lt;article class=&quot;card&quot; data-align=&quot;left&quot; data-size=&quot;small&quot; /&gt; looks attractive — it’s mirroring the APIs we’re used to seeing in design systems and component libraries, but bringing it to vanilla HTML and CSS. Indeed, it’s a small step from data attribute selectors to custom pseudo selectors or prop-based selectors when using Web Components (&lt;my-card align=&quot;left&quot; size=&quot;small&quot; /&gt;).</p><p>Still, for now, if you’re not yet using custom elements, there’s a big difference between</p><pre>&lt;article class=&quot;card&quot; data-loading=&quot;true&quot; data-variant=&quot;primary&quot; data-size=&quot;large&quot; data-border=&quot;top right&quot; data-elevation=&quot;high&quot; /&gt;</pre><p>and</p><pre>&lt;button aria-label=&quot;Toggle menu&quot; aria-controls=&quot;navbar-menu&quot; aria-expanded=&quot;true&quot; disabled /&gt;</pre><p>While I wholeheartedly agree with using attributes over classes when they’re already present, adding your own may be a harder pill to swallow. Tapping into native attribute selectors doesn’t conflict with any existing CSS methodology you may be using, but adding custom ones may require a bigger commitment and change in the overall naming conventions in your codebase. It may also make it more difficult to gauge from the HTML alone which attributes are for behaviour versus just styling concerns. And, ultimately, there’s that nagging feeling that you’re going against the grain by repurposing data attributes for styling — after all, selecting elements is what classes are <em>for</em>, and what browsers optimise for in selector performance.</p><p>Even so, it’s an enticing proposal and I’m excited to see how people continue to shape it. <a href="https://twitter.com/devongovett/status/1576635415024390144">Devon Govett</a> endorses a split where he uses class names for the component itself, but represents all internal variants and state with data-* or aria-* attributes. There are some great insights in this thread for those who would like to dig deeper.</p><h3>Devon Govett on Twitter: &quot;New favorite styling method: class names for components, data/aria attributes for states.Attributes are so much better than classes for states. No need to mess with string concatenation of conditional class names, you can have values instead of only booleans, etc. 👍 pic.twitter.com/eNs9xYjiPO / Twitter&quot;</h3><p>New favorite styling method: class names for components, data/aria attributes for states.Attributes are so much better than classes for states. No need to mess with string concatenation of conditional class names, you can have values instead of only booleans, etc. 👍 pic.twitter.com/eNs9xYjiPO</p><p>While I’m mostly working on codebases using CSS-in-JS these days, where little of this is of much relevance, I can’t wait to rewire my brain to reach for attributes more often. Styling based on ARIA attributes encourages more accessible markup, and styling based on custom data attributes makes it more robust and readable — a better experience for users and developers alike.</p><p><em>Originally published at </em><a href="https://elisehe.in/2022/10/16/attribute-selectors"><strong><em>https://elisehe.in</em></strong></a><em> on October 16, 2022.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=49102cb88f34" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Where’s the fun in accessibility?]]></title>
            <link>https://uxdesign.cc/wheres-the-fun-in-accessibility-b78c6b9d280d?source=rss-c69278bc3913------2</link>
            <guid isPermaLink="false">https://medium.com/p/b78c6b9d280d</guid>
            <category><![CDATA[accessibility]]></category>
            <category><![CDATA[ux]]></category>
            <category><![CDATA[inclusive-design]]></category>
            <category><![CDATA[editor-picks]]></category>
            <category><![CDATA[screen-reader]]></category>
            <dc:creator><![CDATA[Elise Hein]]></dc:creator>
            <pubDate>Thu, 21 Jul 2022 09:19:14 GMT</pubDate>
            <atom:updated>2024-12-02T07:48:51.154Z</atom:updated>
            <content:encoded><![CDATA[<h4>UX is not only about the way it works, but about delight, whimsy, wit, and beauty. But when it comes to accessibility, we tend to take the term literally. Why?</h4><figure><img alt="Colorful abstract clusters of u-shapes layered over each other. Fun!" src="https://cdn-images-1.medium.com/max/1024/0*EXCuQvzAtJbcBm93" /><figcaption>Photo by <a href="https://unsplash.com/@splashabout?utm_source=medium&amp;utm_medium=referral">Nareeta Martin</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>Consider this question posted on the UX community on Stack Exchange:</p><blockquote><a href="https://ux.stackexchange.com/questions/138340/does-including-a-konami-code-triggered-easter-egg-negatively-impact-keyboard-acc">Does including a Konami-code triggered Easter Egg negatively impact keyboard accessibility?</a></blockquote><p>(<a href="https://en.wikipedia.org/wiki/Konami_Code">Konami code</a>, a sequence of specific keypresses, is a cheat code originating from video games. It’s sometimes used as a way to trigger easter eggs on websites.)</p><p>Much of the discussion focuses on how likely it is that the key sequence could be triggered accidentally. The implication is that by minimising any chances of encountering a feature, you can avoid putting in the work to make it accessible. This may be true for Konami code, but it made me wonder — instead of keeping easter eggs and bonus content neatly tucked away so that they don’t break when assistive technology is involved, how often are these elements added with inclusivity in mind from the start?</p><p>We’ve been taught that UX is not only about function, but about delight, whimsy, wit, and beauty. But when it comes to accessibility, we tend to take the term literally: can this be accessed? Articles on accessibility focus on functionality, and the small, non-essential moments of delight are reserved mostly for mouse or touchpad users with good eyesight. What’s the equivalent of a playful design for people who don’t necessarily experience the visual, high-speed or animated version of it?</p><p>Any visual, hearing, motor, vestibular or other impairments I face are mostly situational, so I can’t draw on experience here. I can spot creative touches that don’t work well for users of assistive technologies (I’ll share a few below). It’s a little harder to find those that are added specifically with that audience in mind: by definition, they would likely be lost on me. But when I asked local leading accessibility consultant <a href="https://twitter.com/jakobrosin">Jakob Rosin</a> for his input, his examples, too, were mostly about <em>functional</em> alternatives, not playful ones.</p><p>I’ll cover both here. Training myself to notice these alternative features, while not strictly fun in the sense that I was going for, still helps me move away from thinking of one type of design as the default. Different representations should not be a mere means of accessing some one true default — they’re opportunities to add features and creative touches that shine only in a particular medium.</p><h4>Playful design as a progressive enhancement</h4><p>Let’s start by looking at how common playful touches can leave out users of assistive technologies.</p><p>The simplest example is anything triggered by a pointing device. Think interactive gradient backgrounds that change colour as you hover across a page, particle animations that respond to pointer speed and direction, or any non-essential hover state that doesn’t also respond to a focus event. When not tied to critical functionality, these features are clearly a progressive enhancement, sometimes even intentionally a bit hidden. And you should not feel guilty for getting creative with pointer interactions! But consider the equivalent for a screen reader user — is there anything in your design that elicits the same “huh, that’s neat” reaction from someone who can’t see it?</p><p>To give an example, check out the interactive particle animation presented front and center on <a href="https://www.madebyon.com/?">this agency landing page</a>:</p><figure><img alt="A screen capture of madebyon.com that shows how the agency’s logo is transformed into animated particles that respond to the user’s pointer movement in a satisfying way." src="https://cdn-images-1.medium.com/max/1024/1*f-lTOASiecCg4QV3Nfx1iQ.gif" /><figcaption>The way this particle animation on madebyon.com responds to pointer events is mesmerising.</figcaption></figure><p>I do love the slow, satisfying inertia that ON has fine-tuned to perfection. It invites play. There’s a competitive advantage to features like these, especially in agency land (it’s a bit of a flex, isn’t it). But in many cases the interaction cannot be triggered by keyboard, and there are no alternative, accessible labels — never mind that many people prefer not to encounter motion at all when browsing the web. <a href="https://www.theverge.com/users/s_e_smith">s.e. smith</a> writes in <a href="https://www.theverge.com/23191768/animation-accessibility-neurodivergence"><em>My war on animation</em></a><em>:</em></p><blockquote>I’m not the only one who struggles with parallax scrolling […]. It can also be tough for screen readers to work with, particularly when it’s being used for something like a graphics-heavy display of data. Other people just find it annoying, which seems fair. Could there be an alternative plain or clean version of the same data, presented with the same care? […] <strong>Rather than viewing access as an imposition that narrows your options, think of it as an invitation to think outside the box. (</strong><a href="https://www.theverge.com/23191768/animation-accessibility-neurodivergence"><strong>s.e. smith</strong></a><strong>)</strong></blockquote><p>If a touch of whimsy suits only one particular medium, could we find ways to compensate in others?</p><p>Another example is Google’s long-standing design for their pagination where an <em>o</em> from the stretched out <em>Gooooooogle</em> accompanies each number in the list of results, as if to vocalise how <em>loooooong</em> it is. It’s cute, in an Old Web kind of way. (If anyone knows where I could learn more about the history behind this bit of design, please share!) When you look at the implementation though, the play on… erm, word, is lost inside a neat list of links: Page 1, Page 2, Page 3… Functional, but boring compared to the visual.</p><figure><img alt="A screenshot of the “Goooooooogle” graphic in Google’s pagination, side by side with its accessibility tree showing a simple list of links to pages." src="https://cdn-images-1.medium.com/max/1024/1*7u5diTaSRT3r5QYcHwZljQ.png" /><figcaption>The accessibility tree shows a list titled “Page navigation” that consists of links to all pages. Functionally, this is perfect. But the playfulness of the repeated o<em>’</em>s, added as a background image to each link with CSS, is lost.</figcaption></figure><p>Let’s look at error pages, a quintessential outlet for playfulness in design. When you interrupt your users with an unexpected error, you probably want to do so with friendly humility. Any chuckle you can elicit with a creative illustration will soften the message more. It’s curious, then, to see suggestions like the following in <a href="https://medium.com/docusign-design/a-ux-copywriters-guide-to-accessibility-79dbea85798d">a guide on UX copywriting</a>:</p><blockquote>This is a 500 error page, so instead of the image saying something like: “Drawing of a woman screwing in a lightbulb”, it makes more sense to use “500 internal server error” as the alt text. (<a href="https://medium.com/docusign-design/a-ux-copywriters-guide-to-accessibility-79dbea85798d">Robert Peiffle</a>)</blockquote><figure><img alt="A screenshot of DocuSign’s error page showing a bit of copy and a playful illustration to go with it. The text says “We’re fixing it”, and the illustration shows someone replacing a light bulb on a giant lamp." src="https://cdn-images-1.medium.com/max/1024/1*elL8C3vs2l5Z9Nud2E79sQ.png" /><figcaption>A screenshot of DocusSign’s error page, via <a href="https://medium.com/docusign-design/a-ux-copywriters-guide-to-accessibility-79dbea85798d">Robert Peiffle</a></figcaption></figure><p>I’m not going to argue against this specific use case, as alt text is notoriously difficult to get right and heavily dependent on context. And when it comes to clever illustrations, it may just not pack the same punch. If the copywriting does much of the heavy lifting to deliver the quip, you can probably consider the illustration a bonus. But I would love to learn of examples where the overall message is just as playful for people seeing it, hearing it, viewing it zoomed in or zoomed out, and with or without images or motion.</p><figure><img alt="A screenshot of GitHub’s 404 error page showing an illustration with a parallax effect on the left and the accessibility tree on the right." src="https://cdn-images-1.medium.com/max/1024/1*V3ZzWdVs_4a4yJkIKHLXMg.png" /><figcaption>GitHub’s error page features a Star Wars themed illustration of Octocat with a parallax effect when you hover your mouse over it. The only text exposed is “404 This is not the web page you are looking for”.</figcaption></figure><p>I’d like to look at one more type of non-essential information presented visually, and that’s look and feel. Serif or sans serif fonts, rounded or pointy corners, bright or pastel colours… there’s a lot of tacit information that these small design choices collectively convey. But it is precisely the small design choices that I often see ignored — classed as “decorative” — when reading about accessibility. This leaves the entire burden of branding on voice &amp; tone alone.</p><p>In <a href="https://www.joshwcomeau.com/css/surprising-truth-about-pixels-and-accessibility/"><em>The surprising truth about pixels and accessibility</em></a> (an excellent overview of the long-standing debate), Josh Comeau writes:</p><blockquote>Similarly, how about border widths? It doesn’t really make sense for a border to become thicker as the user scales up their preferred text size, does it?</blockquote><p>This is subtle, but worth challenging — why <em>not</em>?</p><p>Yes, we run into thorny issues around whether the browser zoom function should apply to the full page or just text (I find that most sites nowadays use a mix of both, but check out <a href="https://bugzilla.mozilla.org/show_bug.cgi?id=401322">this 15-year old discussion on Bugzilla</a> for a fun look into platform development history). Your unit strategy also makes little difference for users who only zoom marginally for reading comfort. For someone who routinely browses the web at 250% zoom level though, odds are they cannot make out 1px borders at all. Why shouldn’t we take any opportunity to keep the nonverbal cues in our designs intact for everyone?</p><p>Consider these different uses of borders on <a href="https://www.bbc.com/">bbc.com</a>. Some scale with the text, some don’t.</p><figure><img alt="A screen capture of a news item from bbc.com comparing 100% zoom level and 250% zoom level, showing the size of a decorative border decreasing relatively to the text size until it is barely visible." src="https://cdn-images-1.medium.com/max/1024/1*jBimubLrBXwQduY9gwzmEQ.png" /><figcaption>bbc.com uses 1px for the horizontal separators between titles and authors in their travel section. It’s therefore considered decorative enough to risk not being spotted.</figcaption></figure><figure><img alt="A screen capture of news items from The BBC’s homepage where both relative and absolute sizing have been used for borders." src="https://cdn-images-1.medium.com/max/986/1*FUooDPyWBfj4opv5b1IRCQ.png" /><figcaption>Here, bbc.com uses 1px for the horizontal separators between items, and 0.125rem for the coloured bar next to each item category, likely because the colour conveys meaning.</figcaption></figure><p>The differences are so subtle, but they provide a window into how designers reason about accessibility when it comes to non-essential content.</p><p>It’s fair to say there is a disproportionate focus on visuals, illustrations and motion when it comes to creativity and playfulness. Without the lived experience, it’s tricky for me to imagine equivalents in other representations. But I’d like to share a couple of examples where it has been done beautifully. Please share if you’ve come across others!</p><h4>Playing with broken images</h4><p>In <a href="https://jilt.com/blog/alt-text/"><em>How to get the most out of alt text in your marketing emails</em></a>, Chris Donald talks about fun ways of leveraging alt text for people who have images disabled, or whose network connection is too slow for them to load (certainly a valid audience to consider when it comes to inclusivity).</p><p>First, it’s perhaps not widely known that alt text inherits styling just like other elements. You simply don’t see it unless your images fail to load and the alt text is displayed as a fallback. Any CSS declarations controlling text styling such as colour, font size or family will be applied to the alt text displayed as a fallback if the image fails to load.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/626a7cd36c8e922943bc659e9ef3643e/href">https://medium.com/media/626a7cd36c8e922943bc659e9ef3643e/href</a></iframe><p>This could be neat for text-based images such as logos: the fallback alt text could be styled as a close enough replica of the logo, and the actual image becomes almost a progressive enhancement (remember though that the alt text should remain first and foremost a signal for screen reader users, so if your logo is a link to your homepage with the alt text “Home”, you should probably keep it that way).</p><p>Taking this idea further — and this is where we get to the easter egg! — Chris Donald describes how Sony PlayStation sliced their hero image into separate blocks with different background colours to create fallback pixel art out of those blocks if the images fail to load:</p><figure><img alt="A screenshot comparing the same marketing email side by side with one where the images have loaded correctly, and the other without images, where the background colour used for each slice of the image reveals a pixel art style Autobots logo." src="https://cdn-images-1.medium.com/max/1024/0*W2am8hcjQCXELxEZ.png" /><figcaption>“The email’s hero image has been sliced and styled to reveal the <em>Transformers’ </em>Autobots logo when images are disabled.” (screenshot and quote via <a href="https://jilt.com/blog/alt-text/">Chris Donald</a>)</figcaption></figure><p>This example really captures the essence of deliberately adding alternative versions of playful touches where the standard use case (assuming images will load) doesn’t apply.</p><blockquote>And while those efforts might not be seen (nor appreciated) by the overwhelming majority of your customers, the ones who <em>do</em> pick up on what you’ve done just might appreciate it even more. (Chris Donald)</blockquote><h4>[creatures biting wetly]</h4><p>I can’t help but draw a parallel with closed captioning here. People with hearing loss are by far not the only ones who benefit from closed captions. Just as people on a slow connection who usually want to see images would appreciate surprise pixel art, hearing people who can’t rely on audio just then will welcome well-written captions. (As a parent of young kids, I can’t remember the last time I dared turning the volume up during movie night after the kids’ bedtime).</p><h3>Jonathan Coe on Twitter: &quot;Whoever writes the Stranger Things subtitles is definitely a frustrated poet. pic.twitter.com/MlWMC1Y6FX / Twitter&quot;</h3><p>Whoever writes the Stranger Things subtitles is definitely a frustrated poet. pic.twitter.com/MlWMC1Y6FX</p><h4>Alternative function</h4><p>I mentioned earlier the distinction between alternative fun and alternative function. I’ve been trying my best to find IRL examples of the former, but most of what I covered here requires some imagination to fill in the gaps.</p><p>Going back to some of the examples <a href="https://twitter.com/jakobrosin">Jakob Rosin</a> mentioned, he focused on products that provide different functionality specifically suited to each medium. While not quite the easter egg, almost non-essential type features I was looking for, his examples highlight an interesting area of inclusive design: instead of making a feature merely <em>accessible</em> via different mediums, consider whether it’s actually useful at all in those mediums, and provide alternatives or configuration options where appropriate.</p><p>Jakob mentions the various <a href="https://www.apple.com/ios/ios-16-preview/features/">customisation options introduced for the lock screen on iOS 16</a>: fonts, colour, photos, layout, and other visuals. This is fun for sighted people, possibly essential for the partially sighted, but doesn’t make much sense for people who can’t see the screen at all. What are the equivalent configuration options for other senses? The specific sounds your phone makes or haptic feedback it gives when locking and unlocking, for example, are not currently configurable (bar the ability to switch them off).</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2FRH9cezXEFS0%3Ffeature%3Doembed&amp;display_name=YouTube&amp;url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DRH9cezXEFS0&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2FRH9cezXEFS0%2Fhqdefault.jpg&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=youtube" width="854" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/677bd4fa4fa200504db984904e60f368/href">https://medium.com/media/677bd4fa4fa200504db984904e60f368/href</a></iframe><p>An example Jakob gave of a product that gets it right is <a href="https://slack.com/help/articles/360000411963-Use-Slack-with-a-screen-reader">Slack</a>. In its onboarding flow, Slack asks screen reader users which order they would like to hear content presented in. For example, should the time of a message be announced before its body or vice versa? This would never make sense for people perceiving the UI visually, and that’s what makes it stand out — it’s a different feature, added with a different user group in mind.</p><p>We can flip this idea around. Indeed, many of the problems we face when designing for a sighted audience are not problems at all for screen reader users. For example, instead of requiring an extra action to reveal truncated labels (in tables, say), just present them in full. Screen space is not an issue here, and reading the full label is no doubt faster for the sped up synthetic voice of a screen reader than explicitly revealing a hidden part. If you’re controlling truncation in CSS with text-overflow: ellipsis, screen reader users <em>already</em> hear the full content as given in the source. I love this example because it makes the <em>tooltip</em> the alternative experience — not the ARIA label or alt text or focus state.</p><figure><img alt="A screen recording showing how hovering over a truncated table column heading in Airtable (“Ignor…”) reveals a tooltip with the full heading label (“Ignore in total cost”)." src="https://cdn-images-1.medium.com/max/688/1*d34lDjTnD9giwZJopDp1oQ.gif" /><figcaption>Airtable truncates table headings with CSS. The tooltip here is an accessibility improvement for sighted users 🙂</figcaption></figure><p>It might be premature to talk about playful touches when the accessibility lobby is still trying their best to get the basics down. If you’re familiar with the idea of the adjacent possible, the thought that we have not only the luxury, but even the <em>possibility</em> to focus on fun in non-visual mediums may be ridiculous. You can’t get creative with what isn’t there!</p><p>Content and function obviously take priority. Still, I hope these examples sparked an idea or two. As we learn to stop viewing the visual, high-definition, high-speed experience as the default, we’ll become better at noticing gaps in functionality. The fun should soon follow!</p><h4>Update: 21st September, 2022</h4><p>This article has been making the rounds for a while so I thought I’d share some more interesting examples of creative touches in accessible design that people have brought up as feedback. It’s been encouraging to see that the landscape isn’t as devoid of playfulness as I initially thought!</p><p>I’m going to be updating this list as I come across more fun examples.</p><ul><li><a href="https://twitter.com/fraktalisman/status/1557760281199132673?s=21">@franktalisman</a> shared a presentation by Vasilis van Gemert on voicing animations by making screen readers sound a bit unexpected and silly.<br>See: <a href="https://beyondtellerrand.com/events/dusseldorf-2022/speakers/vasilis-van-gemert"><em>Exclusive Design</em></a></li><li><a href="https://twitter.com/joshwcomeau/status/1550592023618527233?s=21">@JoshWComeau</a> shared his generative art tool, <a href="https://tinkersynth.com/">Tinkersynth</a>, which gives keyboard users <em>more</em> control over sliders than mouse users.<br>See: <a href="https://tinkersynth.com/">Tinkersynth</a></li><li>As a less encouraging example, <a href="https://twitter.com/ckundo/status/1550618716081119232?s=21">@ckundo</a> brought up <em>stramps</em> — ramps that blend into staircases. You can see how the intention might have been to bring an artistic touch to something perhaps a little bosring, but the result is a dangerous loss in functionality.<br>See: <a href="https://incl.ca/the-problems-with-ramps-blended-into-stairs/"><em>The problems with ramps blended into stairs</em></a></li><li><a href="https://twitter.com/jakobrosin">Jakob Rosin</a> mentioned a clever way of bringing more expressiveness to <em>team</em> or <em>about</em> pages on marketing sites by adding audio clips of people’s voices next to their photos.<br>See: <a href="https://voxmate.com/about">Voxmate</a></li><li><a href="https://twitter.com/jakobrosin">Jakob Rosin</a> also brought up audio logos — adding an alternative audio representation to a visual logo. Sonic branding is a concept traditionally more common in advertising and broadcasting, but, indeed, there is no reason why we couldn’t use elements of it in digital products and services, too.</li><li><em>[2nd October 2022]</em> I was listening to <a href="https://thecsspodcast.libsyn.com/049-accessibility"><em>Episode 049: Accessibility</em> of <em>The CSS Podcast</em></a>, where <a href="https://twitter.com/argyleink">Adam Argyle</a> describes how he animates outline-offset on focus states from a larger focus ring to a smaller one, creating a cool zoom effect when using the keyboard to tab through elements.<br>See: <a href="https://thecsspodcast.libsyn.com/049-accessibility">Episode 049: Accessibility</a></li></ul><p><em>Originally published at </em><a href="https://elisehe.in/2022/07/19/the-fun-in-accessibility"><strong><em>https://elisehe.in</em></strong></a><em> on July 19, 2022.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b78c6b9d280d" width="1" height="1" alt=""><hr><p><a href="https://uxdesign.cc/wheres-the-fun-in-accessibility-b78c6b9d280d">Where’s the fun in accessibility?</a> was originally published in <a href="https://uxdesign.cc/">UX Collective</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Framework-free, no-build websites: how far can they take you in 2021?]]></title>
            <link>https://javascript.plainenglish.io/using-the-platform-instead-of-frameworks-33b4607fc3cc?source=rss-c69278bc3913------2</link>
            <guid isPermaLink="false">https://medium.com/p/33b4607fc3cc</guid>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[coding]]></category>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[web-development]]></category>
            <dc:creator><![CDATA[Elise Hein]]></dc:creator>
            <pubDate>Fri, 03 Sep 2021 08:56:29 GMT</pubDate>
            <atom:updated>2021-09-05T23:14:39.699Z</atom:updated>
            <content:encoded><![CDATA[<h3>Using the Platform</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*pLrKeFPzEmK6IDnahMWQBA.png" /><figcaption>A still from an animated diagram in <a href="https://schematics.elisehe.in/">Schematics: A Love Story</a>, a framework-free website that uses no build tools. Incidentally a metaphor for volatility in JavaScript trends.</figcaption></figure><p>I recently came across a series of articles by Daniel Kehoe introducing <a href="https://tutorials.yax.com/articles/build-websites-the-yax-way/quicktakes/what-is-the-yax-way.html"><em>The Stackless Way</em></a>, an optimistic take on web development that proposes we “use the platform” (modern features built into the language) instead of frameworks and build tools that keep getting replaced every few years.</p><p>It was good timing — framework fatigue is real! So, instead of finally getting into Rollup to replace an ancient Browserify build in one of our codebases (which could also really use that upgrade from Polymer to LitElement…), I decided to go “stackless”. I took a long-time idea for a motion design project and built it using nothing but features native to the browser: vanilla JavaScript, ES6 modules, and web components.</p><p>Working on a codebase with no dependencies has been a way of rediscovering exactly what I get for free in 2021, and what value I’m adding by bringing frameworks, transpilers and bundlers to the mix. I’d like to share what I learned (and what I needed to unlearn) in the process.</p><h4>The project</h4><p>The project itself, <a href="https://schematics.elisehe.in/"><em>Schematics: A Love Story</em></a>, is a collection of animated diagrams from a visual poetry book by the same name. If you’re interested in the detailed implementation, have a look at <a href="https://github.com/elisehein/schematics">the repository</a> on GitHub.</p><p><a href="https://schematics.elisehe.in/">Schematics → A Love Story</a></p><h3>The Stackless Way</h3><p>Daniel Kehoe is not alone in his push-back on the complexity of the modern web. Frank Chimero’s <a href="https://frankchimero.com/blog/2018/everything-easy/"><em>Everything Easy is Hard Again</em></a> gets to me every time, and, more recently, I enjoyed <a href="https://medium.com/codex/youre-missing-out-on-vanilla-js-91aceec917d6">this lighthearted rant</a> about the lack of appreciation for vanilla JS.</p><p>Appeals for external JS dependencies to be added with thoughtful intent have become common, but some schools of thought question the concept of single-page apps as a whole: server-side rendering is still a thing, after all. Pages can also be pre-built into a fully static site and served from a CDN (see <a href="https://jamstack.org/what-is-jamstack/">Jamstack</a>). These approaches recognise that we can move some of the complexity currently managed by front-end frameworks elsewhere on the stack.</p><p>But Kehoe’s series of articles on going stackless feels a little different. It’s not just about JavaScript — it’s a wholehearted devotion to the native features of the web as a platform (Routing? Just make sure every URL matches a .html file!)</p><p>There are limits to this kind of purism, of course. The Stackless Way, to me, is less of a realistic approach to building production web apps and more of a learning and introspection tool, a way to take a step back and fall in love with the platform again.</p><p>Being all about motion design, my own project relied on many a setTimeout and page transitions — a single-page app, really… just handcrafted. The two main technologies that made it possible are ES6 modules and web components, which, along with module CDNs, form the pillars of The Stackless Way.</p><h3>ES6 modules</h3><p>If you’ve been developing for the web for some time, you might remember doing this:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/daaae0091cb002a0089aba9993336201/href">https://medium.com/media/daaae0091cb002a0089aba9993336201/href</a></iframe><p>Listing all required scripts separately in the document &lt;head&gt; was all we could do given the lack of support for a native import/export mechanism in JavaScript. This was, of course, suboptimal:</p><ul><li>each script tag initiates an HTTP request;</li><li>there is no namespacing (all scripts exist in the global scope);</li><li>the order of execution is linear, and maps directly onto the ordering of the script tags.</li></ul><p>To combat this, approaches to modularity in JavaScript have proliferated over the years (AMD, UMD, CommonJS), and along with them, build tools and bundlers to convert the modular code into something that the browser understands.</p><p>ECMAScript Modules (also referred to as ESM or ES6 Modules) is the first <em>native</em> standard for modules in JavaScript. I emphasise <em>native</em> here because that means we can ditch the build tools and bundlers in favour of &lt;script type=“module”&gt; in HTML and import/export in JS:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/53e98f2e76108671651f797473962d2f/href">https://medium.com/media/53e98f2e76108671651f797473962d2f/href</a></iframe><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/25f4e876792022c6aa46fc592b04a668/href">https://medium.com/media/25f4e876792022c6aa46fc592b04a668/href</a></iframe><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/3a0c8ac8e827886363975b41de6c5b4a/href">https://medium.com/media/3a0c8ac8e827886363975b41de6c5b4a/href</a></iframe><p><strong>Native support for modularity is the most important step towards a build-free codebase.</strong> If I had access to only one <a href="http://es6-features.org/">ES6 feature</a> for the rest of my life, I’m confident that modules would take me most of the way there when it comes to well-structured native JavaScript.</p><p>And not having to build your JS app is magical. Setting up the directory structure for <em>Schematics</em>, I was giddy with excitement skipping npm run build and seeing my source files mirrored — as is! — in the browser. It reminded me of when I first began building websites and double-clicking index.html was enough to preview your work.</p><p>You do need a local server if you’re using ES6 modules (so double-clicking an HTML file might be a thing of the past for good). But there’s no lag between editing your code and seeing changes in the browser, and the source code you see in the inspector is exactly what you typed into your editor (no sourcemaps!).</p><p>Nevermind the faster edit-compile-debug cycle — this speaks directly to Chimero’s concern about the <a href="https://frankchimero.com/blog/2018/everything-easy/">lack of legibility in today’s codebases as an obstacle to learning the craft</a>:</p><blockquote>Before, the websites could explain themselves; now, someone needs to walk you through it. Illegibility comes from complexity without clarity. I believe that the legibility of the source is one of the most important properties of the web. […] the best way to help someone <em>write</em> markup is to make sure they can <em>read</em> markup.</blockquote><blockquote>— <a href="https://frankchimero.com/blog/2018/everything-easy/">Frank Chimero</a></blockquote><h4>The future of app bundles</h4><p>Just because you don’t strictly need a build tool to <em>run</em> your code, doesn’t mean you shouldn’t use one for production builds to optimise performance. I’m referring here not to transpilation, but to minification, mangling, tree-shaking, etc.</p><p>I’ve been bundling JavaScript into a single app.js file for such a long time that my first instinct was to concatenate everything into a single script on <em>Schematics</em>, too. This, of course, will not work with ES6 modules — the concept of files is what creates boundaries between different modules, and there is no way to specify more than one module per file.</p><p>Luckily, you don’t need to bundle your ES6 modules into a single file to improve performance. Let me repeat: <strong>you don’t need to bundle your ES6 modules into a single file to improve performance</strong>.</p><p>Here’s why:</p><ol><li>&lt;script type=“module&quot;&gt; requests are <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Modules#other_differences_between_modules_and_standard_scripts">deferred by default</a>: they won’t block document parsing.</li><li>Serving all modules from separate source files is great for caching, as the modules unaffected by some change can continue being retrieved from the cache. When you serve a single bundle, any one change will invalidate the whole bundle.</li><li>You can lazy load parts of your code by making use of <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/import#dynamic_imports">dynamic imports</a> — importing modules during runtime at the point where you actually need them.</li><li>You can preload critical modules with <a href="https://developers.google.com/web/updates/2017/12/modulepreload">modulepreload</a>. This starts parsing and compiling the linked modules immediately, off the main thread.</li><li>Finally, HTTP2 may in the future allow us to resolve the entire dependency graph from the first &lt;script type=“module”&gt; request, and send all required files back in a single response. For the time being, this requires bespoke logic written on the server side.</li></ol><p>And don’t forget about bundle size:</p><blockquote>If you inspect the output code generated by most popular bundlers, you’ll find a lot of boilerplate whose only purpose is to dynamically load other code and manage dependencies, but none of that would be needed if we just used modules with import and export statements!</blockquote><blockquote>— <a href="https://philipwalton.com/articles/using-native-javascript-modules-in-production-today">Philip Walton</a></blockquote><p>For more details and interesting discussion around ES6 module load performance and app bundles, see <a href="https://esdiscuss.org/topic/fwd-are-es6-modules-in-browsers-going-to-get-loaded-level-by-level">this thread on the ECMAScript Discussion Archives</a>. The spec is not set in stone yet, and there are plenty of ideas floating around, some more daring than others (my personal favourite is the proposal to serve the entire module dependency graph as a .zip file).</p><blockquote>There’s plenty of ongoing module work happening in Chrome, though, so we’re getting closer to giving bundlers their well-earned rest!</blockquote><blockquote>— <a href="https://developers.google.com/web/updates/2017/12/modulepreload">Sérgio Gomes</a></blockquote><p>More reading:</p><ul><li><a href="https://philipwalton.com/articles/using-native-javascript-modules-in-production-today/">Using Native JavaScript Modules in Production Today</a></li><li><a href="https://tutorials.yax.com/articles/javascript/import/index.html">JavaScript Import Explained</a></li><li><a href="https://medium.com/backticks-tildes/introduction-to-es6-modules-49956f580da">Introduction to ES6 modules</a></li></ul><h3>Web Components</h3><p><a href="https://developer.mozilla.org/en-US/docs/Web/Web_Components">Web Components</a> is an umbrella term for several native technologies (Custom Elements, Shadow DOM and HTML templates) that let us bundle the markup and dynamic behaviour of an element into a reusable piece of code, on a high level no different to the React or Vue component. As of May 2021, <a href="https://webcomponents.dev/blog/all-the-ways-to-make-a-web-component/"><em>All the Ways to Make a Web Component</em></a> lists 55 variants of a hypothetical &lt;my-counter&gt; component for comparison across bundle size, coding style and performance. Native web components, of course, stand out because they have no external dependencies (and, consequently, an unmatched tiny bundle size).</p><h3>Web Component Bytes on Twitter: &quot;A comprehensive guide to setting up your web component tool chain: 🧵👇 / Twitter&quot;</h3><p>A comprehensive guide to setting up your web component tool chain: 🧵👇</p><h3>Web Component Bytes on Twitter: &quot;Congrats, you&#39;re now ready to go 🎉 / Twitter&quot;</h3><p>Congrats, you&#39;re now ready to go 🎉</p><p>Here are some of my own impressions of web components as compared to external frameworks when it comes to DX and architecture.</p><h4>Shadow DOM and &lt;template&gt;</h4><p>The shadow DOM, a way of keeping the internals of a component inaccessible to the main document, is a neat feature in theory, but a natural use case for it didn’t really arise when working on <em>Schematics</em>. I can see the shadow DOM being useful in cases where a component is reused across many sites and in unpredictable contexts (such as elements in a UI library); for your standard &lt;site-specific-header-dropdown&gt;, it doesn’t add much value.</p><p>The &lt;template&gt; and &lt;slot&gt; elements (the latter only useful if you’re using the shadow DOM) are presented as a means of adding hidden markup inside JS, but they feel clunky if you’re used to something like JSX. Additionally, the &lt;template&gt; tag <a href="https://stackoverflow.com/a/53317973">seems counter-inuitive if the aim is to create portable components</a> that can be included in an app with a single import. When declared in the HTML, any JavaScript referencing the &lt;template&gt; makes assumptions about what’s available to it in the main document. Indeed, at times the index.html in <em>Schematics</em> felt like a dumping ground for various &lt;template&gt;s, rather than a neat overview of the page structure.</p><p><a href="https://developer.mozilla.org/en-US/docs/Web/Web_Components/HTML_Imports">HTML Imports</a> was a proposal that might have allowed us to package JS and HTML together into a single bundle, making &lt;template&gt; the star of the show. Unfortunately, the feature never took off.</p><p>Another <a href="https://github.com/whatwg/html/issues/2254">proposed feature</a> is a means to add variables, simple statements and event handlers to nodes in a &lt;template&gt; tag. The gist of it is similar to what you’d currently see in front-end frameworks:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/ab1774eb9df60c4180b2cd5c9929f6b9/href">https://medium.com/media/ab1774eb9df60c4180b2cd5c9929f6b9/href</a></iframe><p>Being accustomed to built-in data-binding in frameworks, until the variables above are automatically updated, the feature feels half-baked. As it stands, it’s difficult to gauge the full, declarative markup of a component in one place, as update logic is scattered throughout the class with query selectors, innerHTML, document fragments and the like.</p><ul><li><a href="https://github.blog/2021-05-04-how-we-use-web-components-at-github/">How we use Web Components at GitHub | The GitHub Blog</a></li><li><a href="https://medium.com/swlh/https-medium-com-drmoerkerke-data-binding-for-web-components-in-just-a-few-lines-of-code-33f0a46943b3">Data binding for Web Components in just a few lines of code</a></li></ul><h4>Extending native elements</h4><p>The web components feature I was most excited about, and one that a third-party framework inherently cannot provide, is <a href="https://developer.mozilla.org/en-US/docs/Web/Web_Components/Using_custom_elements#customized_built-in_elements">the ability to extend native HTML elements</a>. This allows you to inherit any built-in behaviour for that element in your component, including accessibility-specific properties. Unfortunatley, <a href="https://dev.to/lkraav/comment/ad06">Apple have decided not to support customizable elements in Safari</a>.</p><p>This is disappointing. Using front-end frameworks, we often implement our own, more snazzy versions of native HTML elements. Input elements especially, such as dropdowns and radio buttons, are tricky to style using CSS and often end up reproduced with JS. But reproducing the required ARIA attributes, keyboard navigation and the like requires extra effort — something we would get for free with customizable elements.</p><h4>Components all the way down?</h4><p>While ES modules sparked excitement for the future, I was left underwhelmed by the prospect of native web components replacing traditional front-end frameworks. But in hindsight, weighing up web components against JS frameworks was missing the point of the exercise.</p><p>Being a React user, attaching my App.js root component to a &lt;div id=“app”&gt; root node and working down the tree, in smaller components, is how I’m used to thinking about SPAs. Though you <em>can</em> attach your component onto individual DOM nodes (and you could easily mix and match frameworks, too), the more standard approach is to let the framework drive the whole page.</p><p>This will quickly fall apart when using web components. At the level of the atomic UI element, they shine; for the business logic and user flows, you should defer to a different part of your stack. As for static content — why render it with JavaScript if raw markup does the job perfectly?</p><p>And so, I caught my mindset shifting from an app that’s just one big component to <em>not</em> using components by default, breaking the link between component and framework in the process.</p><p>In the case of <em>Schematics</em>, I ended up with just a couple of main custom elements sitting neatly in the middle of native HTML tags. A simplified illustration of the idea:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/1a0fab89813aa3e7876a97981f235430/href">https://medium.com/media/1a0fab89813aa3e7876a97981f235430/href</a></iframe><p>It seems obvious in hindsight that a component should encapsulate the behaviour and appearance of some bit of UI. But, as <a href="https://dev.to/redbar0n/what-happened-to-components-being-just-a-visual-thing-22hc">this article nicely puts it</a>, with the proliferation of JS frameworks, “we’ve landed over in the ditch on the other side of the road: putting all sorts of behaviour into the same JSX-denoted structure as Components”.</p><blockquote><em>“React renders your UI and responds to events” was </em><a href="https://youtu.be/x7cQ3mrcKaY?t=79"><em>how it was introduced</em></a><em>. Not: “React is a way to transform and execute all your logic in a hierarchy of declarative markup”, as it has devolved into in many cases.</em></blockquote><blockquote><em>— </em><a href="https://dev.to/redbar0n/what-happened-to-components-being-just-a-visual-thing-22hc"><em>Magne</em></a></blockquote><p>These thoughts are mostly based on first impressions. If you’re interested in a more detailed review of the state of the web components spec, I recommend <a href="https://webreflection.medium.com/about-web-components-cc3e8b4035b0">this excellent article by Andrea Giammarchi</a> which takes a critical look at the feature in the context of the 30-year history of the web.</p><p><a href="https://webreflection.medium.com/about-web-components-cc3e8b4035b0">About Web Components</a></p><h3>The future of stackless</h3><p><em>Schematics</em> was a simple project as far as architecture goes, and web components and ES6 modules took me most of the way there. But I can’t see myself building a more complex app without a framework. Fully static sites, too, are simpler to build using a generator like Jekyll: something like markup reuse across pages is impossible when you only have the browser and text editor to work with (the humble &lt;iframe&gt; might disagree with me here…).</p><p>Technical limitations aside, an issue I became aware of during this exercise was a lack of standards in vanilla JavaScript. Because we’re so used to the framework dictating how to structure our codebase, there aren’t many established guidelines should you decide to handcraft your JavaScript. Never mind the high-level architecture — even the way you define a class, use static variables, or implement composition all have a range of approaches to them. Web components fill in the gap when it comes to the UI; perhaps if more developers dared to go framework-free (when appropriate!) discussions around best practices would be more productive.</p><h3>Know the platform</h3><p>Developing web apps without frameworks or build tools is not an end goal in and of itself. As Daniel Kehoe put it in the stackless newsletter:</p><blockquote><em>I don’t think we’ll be talking about “stackless” in a few years. It’s just going to be part of any web developer’s professional bag of tricks.</em></blockquote><p>I’d love to see that happen. I have a special disdain for beginner JavaScript tutorials that have you run create-react-app as the first step, and this exercise has only strengthened my conviction that every beginner programmer should get to grips with HTML, CSS and vanilla JS before delving into frameworks. Features native to the web are what all frameworks share, and knowing the platform makes for a stronger foundation in the face of change.</p><p><em>Originally published at </em><a href="https://elisehe.in/2021/08/22/using-the-platform"><strong><em>https://elisehe.in</em></strong></a><em> on August 22, 2021.</em></p><p><em>More content at </em><a href="http://plainenglish.io/"><strong><em>plainenglish.io</em></strong></a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=33b4607fc3cc" width="1" height="1" alt=""><hr><p><a href="https://javascript.plainenglish.io/using-the-platform-instead-of-frameworks-33b4607fc3cc">Framework-free, no-build websites: how far can they take you in 2021?</a> was originally published in <a href="https://javascript.plainenglish.io/">JavaScript in Plain English</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[The hidden insights in developers’ Google searches]]></title>
            <link>https://medium.com/design-bootcamp/the-hidden-insights-in-developers-google-searches-47f05030cd2d?source=rss-c69278bc3913------2</link>
            <guid isPermaLink="false">https://medium.com/p/47f05030cd2d</guid>
            <category><![CDATA[ux-research]]></category>
            <category><![CDATA[developer-experience]]></category>
            <category><![CDATA[dx]]></category>
            <category><![CDATA[ux-research-method]]></category>
            <category><![CDATA[ux]]></category>
            <dc:creator><![CDATA[Elise Hein]]></dc:creator>
            <pubDate>Sun, 11 Apr 2021 03:40:12 GMT</pubDate>
            <atom:updated>2022-07-22T10:15:36.503Z</atom:updated>
            <content:encoded><![CDATA[<h4>A selection of real search queries, and what they can teach us about designing for developers.</h4><figure><img alt="A screenshot of Google’s search page." src="https://cdn-images-1.medium.com/max/1024/0*8FfIrN0ucfq5WWm-" /><figcaption>Photo by <a href="https://unsplash.com/@christianw?utm_source=medium&amp;utm_medium=referral">Christian Wiediger</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>Most of what developers do day to day involves lookups of one kind or another online: referencing documentation, choosing frameworks, investigating errors, checking keyboard shortcuts, and more.</p><p>Since online search is such an integral part of our work, it can act as a rich source of data about development practices, highlighting areas where good design can make a difference. A few years ago, I conducted <a href="https://elisehe.in/i/googledrivendevelopment.pdf">research</a> into exactly that — <strong>for two weeks, I collected the searches of 18 developers who volunteered for the study, asking them to explain some of their queries in detail every day</strong>.</p><p>The aim of the study was to look at search tooling specifically; it was only later that I realised the data might be interesting in a more general sense, too. Plus, a plain English summary of the <a href="https://elisehe.in/i/googledrivendevelopment.pdf">full report</a> is <em>long </em>overdue…</p><p>So, I’d like to offer here a curated selection of the search queries of those 18 programmers. I’ll cover what was sought for (the different informational goals), and how (the strategies yielding the best results). I’ll point out the occasional design implication, but — mostly — I want to illustrate the breadth of contexts and search styles, showing how search logs can act as an intimate window into the daily work of developers.</p><h3>The data set</h3><p>All participants signed an informed consent form and were fully aware of their search history being shared for the duration of the study. Their data was kept anonymous and used only for the research.</p><p>In total, I collected 2488 programming searches from 18 developers over two weeks of tracking. Participants made an average of 15.9 searches a day (<em>min=1, max=83</em>). Of all searches, 347 were annotated, which means the developer who made the search explained the context in further detail. Those 347 annotations were what I based most of the analysis on.</p><h3>Search categories</h3><p>I identified six search categories in the data. From most to least popular, they were:</p><ul><li><strong>Ad hoc how-tos</strong>.<strong> </strong>The developer is in the middle of a task, knows what they need to do next, but doesn’t know how.</li><li><strong>Understanding an API</strong>.<strong> </strong>The developer wants to learn about the particulars of a language API or any third-party code they’re working with (libraries, frameworks etc), often concerning low-level details.</li><li><strong>Recalling forgotten details</strong>. The developer needs to look up the specific syntax or naming of something.</li><li><strong>Learning, research and investigation</strong>. The developer is exploring best practices, trade-offs and popular opinions, or learning about something new.</li><li><strong>Troubleshooting</strong>. The developer is looking for the cause of an error or how to fix it.</li><li><strong>Resources</strong>. The developer is looking for tools or libraries, or official documentation for those tools or libraries.</li></ul><h4>Ad hoc how-tos</h4><p>With almost a third of all queries falling into this category, finding practical techniques for immediate use was the most common search motivation seen.</p><blockquote>angular route uib tab Was wondering how to combine UIB library’s tab directive with Angular UIRouter.</blockquote><blockquote>react setstate sub property In React, state is immutable so you have to reset the state as a whole, but I wanted to mutate a sub key and set the state in one line.</blockquote><p>When unaware of the exact APIs or techniques involved, the developer simply described the desired outcome:</p><blockquote>bootstrap button next to input I wanted to align a button next to an input field using Bootstrap.</blockquote><h4>Understanding an API</h4><p>This category somewhat overlaps with how-to and recall searches, but what sets it apart is the interest in the official documentation of a particular language, library of framework.</p><p>Some searches in this category (like php preg_match) were generic; others were motivated by questions like <em>Is this supported?</em> or <em>How has it been implemented?</em> Examples include:</p><blockquote>forcelayout api Was searching for an ability to select parent node in D3 force-layout.</blockquote><blockquote>golang copy built in I was trying to understand memory efficiency when <em>[this function is]</em> used with slices.</blockquote><p>Less so in other categories, searches here were sometimes prompted by reading code authored by someone else. This illustrates the wonderful learning opportunities hidden in code reviews!</p><blockquote>strlen I saw this php function in code and didn’t know what it did.</blockquote><blockquote>java comparator interface → java default string comparator I was reviewing some code written by a consultant and was wondering why they were not using methods/classes from the standard library.</blockquote><h4>Recalling forgotten details</h4><p>This one is self-explanatory: the developer knows what she’s doing, but doesn’t remember the specific syntax or naming. With these searches, a quick code example is what people were often after.</p><blockquote>ubuntu search packages Searched after the command that’s used to search for programs on Linux Ubuntu.</blockquote><blockquote>URI uri = new URIBuilder To make sure the syntax is correct.</blockquote><blockquote>java throw exception example Looking for the correct syntax for method error throwing.</blockquote><p>People often had a specific website in mind with these queries — they had likely made the search in the past and knew exactly where to look (this could also explain why a single search was often enough in this category). In this example, mdn refers to <a href="https://developer.mozilla.org/">Mozilla Developer Network</a>:</p><blockquote>mdn transform origin CSS transform syntax.</blockquote><p>Appearing in nearly 20% of all cases, the notable thing about recall searches was that they occurred as much as they did. Many IDEs are syntax-aware and have built-in documentation. Indeed, without those features the proportion of recall searches may have been even greater. Or, perhaps we’re at peak efficiency — a quick switch to the browser is so ingrained in muscle memory and usually yields quick results for recall searches, so what is the point of a specialised tool?</p><h4>Learning, research and investigation</h4><p>Queries here were about generic concepts (e.g., job queue), best practices (e.g., bad things about scala implicits) or trade-offs (e.g., svg vs png). They often occurred when planning a change or embarking on an unfamiliar task:</p><blockquote>segmented circle css We’re implementing a new design that looks like a donut cut into 8 parts — wanted to see what was possible with CSS vs SVG.</blockquote><blockquote>best programming language for both ios and android → app dev design, what languages to use → code java app for ios and android → write helloworld ios app in java Been tasked with designing an app, no idea where to start.</blockquote><p>But there were also instances of casual curiosity:</p><blockquote>boilerplate template My colleague was talking about boilerplate templates and that I should check them out. So I Googled to find out what they were.</blockquote><h4>Troubleshooting</h4><p>We all know the feeling — something is failing and you don’t know why; annoyed, you copy and paste the error message into Google and hope for the best.</p><blockquote>show is not a member of org.apache.spark. sql.GroupedData I didn’t know why I couldn’t show GroupedData. I wanted to find how to do it.</blockquote><blockquote>Possible infinite loop detected This was an error message from the percona tools I was using to sync up the replica instance with the master.</blockquote><p>Unlike in other searches, the queries here were consistently structured: they frequently either described the problem or used the error message verbatim. It is also here that queries were most often refined, with at least one instance of refinement in about half of the queries:</p><blockquote>babel-jest → can’t console log in babel jest → logging in babel-jest → jest-cli Thought I was in a different file than I actually was in so when running specs I couldn’t get console.log to work.</blockquote><h4>Resources</h4><p>The resources people sought for were most often third-party tools and libraries to integrate into their current project. For instance:</p><blockquote>json minify I wanted to find an online minifier tool to reduce whitespace in JSON. Standard JS minify wouldn’t work.</blockquote><blockquote>rails kineses gem I’m looking at migrating our analytics pipeline to AWS and so I wanted to see if there were any gems to support this.</blockquote><p>The rest were searches for reference tables such as character codes or keyboard shortcuts (e.g., unicode <em>Looking for a unicode table</em>), or things like dummy data generators. These searches stood out for being just as likely to occur during coding as during higher-level planning and research.</p><h3>Search strategies</h3><p>We’ve covered what people search for. Let’s now look at the <em>how: </em>the strategies employed when formulating the query and evaluating results.</p><h4>Choice of search engine</h4><p>Though most people in the study said they use several alternative search engines, only 5% of searches logged were actually made on something other than Google. DuckDuckGo was the search engine of choice for one participant, and only sometimes did people search directly on specialised sites like <a href="https://developer.mozilla.org/en-US/">Mozilla Developer Network</a>, <a href="https://github.com/">GitHub</a> or <a href="https://hoogle.haskell.org/">Hoogle</a>.</p><p>Multiple services were sometimes used during a single search session, as seen here:</p><blockquote><em>Google:</em> sumo collector filters → <em>Google:</em> sumo collector filters include → <em>Sumo Logic Community: </em>filters include → <em>GitHub SumoLogic repository:</em> filters I wanted to see if we’d used filters before in sumologic (we hadn’t). Turns out they don’t work and their docs should be completely removed from SumoLogic’s website.</blockquote><p>For the ten GitHub code searches that were annotated (out of 92 total), motivations varied from investigating low-level behaviour to using source code as documentation (as seen with filters above).</p><p>When it comes to non-browser-based search tools, only one participant had their IDE equipped with web search features. Those who claimed to use offline documentation apps like <a href="https://kapeli.com/dash">Dash</a> still made numerous documentation searches online, too.</p><h4>Query refinement and keyword foraging</h4><p>As already mentioned, queries were refined the least in recall searches, and the most in troubleshooting searches.</p><p>Query refinements weren’t necessarily tied to the type of search, though; they also occurred during keyword foraging, where the person searching doesn’t know what the concepts they need are called. (In the original report, I refer to this as “cross-domain translations”, but I’ve since been made aware of the <a href="https://uxdesign.cc/keyword-foraging-the-key-to-better-search-tools-289e1e150468">much more suitable term</a>.) Often, a familiar term is used first in the hopes that it will lead to better keywords:</p><blockquote>jquery add to list → jquery add to array</blockquote><blockquote>mongoid update_attributes Was looking for the equivalent of a Rails ActiveRecord method in the Mongoid persistence ORM</blockquote><p>There was one particular case of query refinement where search language itself was altered:</p><blockquote>step by step json lexer → comme costruire un lettore json → como crear lexer json</blockquote><p>The participant noted: “Results in Spanish tend to have more extensive explanations. Results in Italian or French yield fewer results typically.”</p><p>The point at which a multi-lingual programmer abandons one language in favour of another can hint at how they evaluate resources. Queries like these also remind us of the importance of considering non-English content in any tool that aggregates resources.</p><h4>Natural language vs code terms</h4><p>Comparing the use of natural language to the use of code terms, recall searches included the most code terms across all categories. This was expected, as people looking for reminders usually have a good idea of the specific line of code they’re about to write.</p><p>Natural language queries (such as full-sentenced questions) were found similarly in all categories. For example:</p><blockquote>does md5sum read file into memory? <em>(Understanding a library or API)</em></blockquote><blockquote>what determines if a site is considered intranet for ie compatibility view settings <em>(Troubleshooting)</em></blockquote><blockquote>javascript library that embed a string and if find an embed content render <em>(Resources)</em></blockquote><p>It seems to me that people sometimes fall back to natural language when the question is highly specific, or expressing it concisely is a struggle. These are the situations where you might want to just turn to the person sitting next to you and ask for help. Perhaps not all questions can be addressed by better IDE or search design.</p><h4>Social validation</h4><p>Finally, a prominent theme that emerged from the searches was the importance of social proof. Mentions of “the best” or “the accepted” way of doing things were frequent across categories:</p><blockquote>react pass state to child I wanted to pass the entire react state object to a child component, this is fairly simple to ‘just do’ but I was looking for the accepted and ‘safe’ way of doing so.</blockquote><blockquote>best process supervisor I was . . . looking for people’s opinion on Linux process supervisors/monitors for managing web processes, workers, etc.</blockquote><blockquote>mysql using index → mysql indexes best practices</blockquote><p>When integrating search into IDEs, one design direction has been to filter and re-format results to make them quickly scannable, prominently featuring code snippets and removing the messy, non-parsable human discussions around them (see <a href="https://homes.cs.washington.edu/~weld/papers/hoffman-uist2007.pdf">Assieme</a> or <a href="http://www.cs.cmu.edu/~NatProg/papers/Stylos2006Mica.pdf">Mica</a>). While useful for syntax lookups and the like, it would completely fail when the aim is to gauge best practices, as with the queries above.</p><h3>Query logs as a research tool</h3><p>For those interested, the <a href="https://elisehe.in/i/googledrivendevelopment.pdf">full write-up</a> contains more detailed analyses of the searches, as well as a description of the methodology. As a closing thought, I’d like to instead further comment on query logs as a research tool in DX.</p><h4>An intimate glimpse into how developers work</h4><p>Because much of the previous studies in this area had been conducted in laboratory settings with made-up programming tasks (e.g., <a href="http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.216.682&amp;rep=rep1&amp;type=pdf">Brandt et al. 2009</a>; <a href="https://homes.cs.washington.edu/~weld/papers/hoffman-uist2007.pdf">Hoffmann et al. 2007</a>), getting to see the very real every-day searches developers make was the most fun and exciting part of the project (and before this comes across as voyeuristic, let me assure you again that the data was fully anonymised!)</p><p>But a search is only a query until you know what prompted it. At this point, we get a glimpse into the wider context of teamwork…</p><blockquote>easing functions examples To showcase to my fellow developer what easing functions are and to show visual examples.</blockquote><p>learning workflows…</p><blockquote>I’m programming something in golang, but I don’t have enough familiarity with <em>[it]</em> . . . so I’m implementing an algorithm in python before I attempt to port it over to the golang code.</blockquote><p>frustrations…</p><blockquote>hook-cron . . . the documentation online for Drupal 6 is non-existent. In fact, I get an un-styled html page that says ‘File not found’ when I click on the docs… useless.</blockquote><p>…and culture:</p><blockquote>git --force Making a nerdy star wars + git joke on slack</blockquote><p>In a sense, then, search log analysis can be thought of as a kind of ethnography, where people’s experiences are captured in the wild as they occur. And search is an interesting proxy to those experiences, as, indeed, it is when facing a problem that people usually turn to Google.</p><p>So, make a note of the next thing you look up online and consider whether it’s a design opportunity in disguise!</p><p><em>Although it’s been a few years since the study took place, I’d like to once more extend my sincerest thanks to the participants whose searches you see in this article. Thank you for trusting me with such personal data!</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=47f05030cd2d" width="1" height="1" alt=""><hr><p><a href="https://medium.com/design-bootcamp/the-hidden-insights-in-developers-google-searches-47f05030cd2d">The hidden insights in developers’ Google searches</a> was originally published in <a href="https://medium.com/design-bootcamp">Bootcamp</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Why should type be fluid, anyway?]]></title>
            <link>https://uxdesign.cc/why-should-type-be-fluid-anyway-f7f32f0d37a3?source=rss-c69278bc3913------2</link>
            <guid isPermaLink="false">https://medium.com/p/f7f32f0d37a3</guid>
            <category><![CDATA[design]]></category>
            <category><![CDATA[ui]]></category>
            <category><![CDATA[typography]]></category>
            <category><![CDATA[ux]]></category>
            <category><![CDATA[responsive-design]]></category>
            <dc:creator><![CDATA[Elise Hein]]></dc:creator>
            <pubDate>Sat, 13 Mar 2021 00:00:00 GMT</pubDate>
            <atom:updated>2021-04-07T04:33:12.924Z</atom:updated>
            <content:encoded><![CDATA[<h4>Viewport units aren’t going to fix your typography.</h4><figure><img alt="Infinite breakpoints. Illustration by author." src="https://cdn-images-1.medium.com/max/1024/0*h2MuMj16QDkCFv-F.png" /><figcaption>Illustration by author</figcaption></figure><p>We call type “fluid” when the text on a web page scales in relation to screen size without any breakpoints. If like me, you’ve just had a marathon catch-up with all things web typography in 2021, the most thrilling part about this concept would seem to be the immense gains in code maintainability.</p><p>Articles on fluid type often introduce the topic by explaining how it can remove complexity in styling<a href="#b65e">¹</a>. One example:</p><blockquote>I wanted to reduce the number of media-queries, but maintain responsiveness. I wanted to reduce the CSS footprint of the website. But above all, I wanted to make my CSS more maintainable. Adding fluidity for font-sizes, element sizes, and spacing contributed to achieving this goal.<em> (</em><a href="https://vycke.dev/blog/fluid-interfaces-using-css/"><em>Kevin Pennekamp</em></a><em>, 2020)</em></blockquote><p>A better developer experience is valuable in its own right. But—compared to a well-executed breakpoint-based design—what exactly is the UX impact of fully fluid type?</p><p>Nothing much, is the short answer. A thoughtfully implemented fluid-type system won’t affect users in any meaningful way—positive or negative. Maybe that’s why discussions on fluid type often just gloss over readability. Plain and simple, it really is mostly about the technical optimisations it affords.</p><p>Still, even if subtle, I can’t help but wonder about how fluidity in design impacts people, and how it matches our expectations of using the web. So, here are my thoughts and findings—some concrete, stemming from visual design and typographic theory, and some of my own (wild?) speculation.</p><h3>Size</h3><p>Let’s start by getting size—and why it’s not what matters here—out of the way.</p><p>First, the obvious: fluid typography is less about the outcome, and more about doing the same thing in a slightly different way. Imagine a breakpoint-based website that shows 14px text on mobile and 22px text on desktop. After you ditch the media queries and scale the text fluidly from 14px to 22px, a lot of people will still go on seeing roughly 14px text on mobile and 22px text on desktop.</p><p>It’s the in-between screen sizes where fluidity makes more of a difference. But here, I think everyone can agree that text set at 17.6px on a 540px screen and scaled down to 15.2px on a 414px screen is not fundamentally better than showing 16px text on both. We must remember that screen width is only a convenient proxy to a much richer and unpredictable viewing context, which, at this level of tiny adjustments, will likely undo any efforts to make sizing perfect.</p><blockquote>Can we count on context? Can we assume that everyone holds a phone or tablet at the same distance, or that desktop browsers are all hunched over a desk? […] Until computers sense a user’s reading distance and adjust page scale proportionally (sounds like a nightmare, right?) we’ll have to make these sensible generalizations.<em> (</em><a href="https://trentwalton.com/2012/06/19/fluid-type/"><em>Trent Walton</em></a><em>, 2012)</em></blockquote><p>Looking at where fluid font sizing can go wrong, the danger is tying it too intimately to the viewport, resulting in text that becomes too small or too big too fast. In 2021, though, this is mostly a non-issue. With the help of <a href="https://css-tricks.com/simplified-fluid-typography/">new CSS features</a>, <a href="https://zellwk.com/blog/viewport-based-typography/">smart implementations</a> avoid extreme scaling by only “sprinkling” the calculation with a tiny viewport multiple, and clamping it to a reasonable minimum and maximum—all the while <a href="https://ntgard.medium.com/accessible-fluid-typography-875c4aac8056">keeping everything accessible</a>!</p><pre>body {<br>  font-size: clamp(1rem, 0.5rem + 2vw, 1.625rem);<br>}</pre><p><em>Type that scales fluidly from 1rem to 1.625rem (16px to 26px in the default case). Clamped, subtle, and accessible. The technique using </em><em>clamp is originally from </em><a href="https://css-tricks.com/simplified-fluid-typography/"><em>Simplified Fluid Typography</em></a><em>; to make it accessible, Nick Gard added relative units in </em><a href="https://ntgard.medium.com/accessible-fluid-typography-875c4aac8056"><em>Accessible Fluid Typography</em></a><em>.</em></p><p>So—fluid typography, if carefully implemented, won’t harm readability. But it also doesn’t have much of an edge over a handful of well-chosen breakpoints and font sizes.</p><h3>Display text and line length</h3><p>I tried and failed to find many specific areas where viewport-relative typography <em>does</em> outperform breakpoint-based sizing in terms of readability. Here are two: setting display text and maintaining consistent line length.</p><ul><li><strong>Display text. </strong>Large textual elements such as titles or bold visual statements look more striking when they are tied to the viewport size. Richart Rutter <a href="https://24ways.org/2016/responsive-display-text/">puts it nicely</a> when he says that “display text, as defined by its purpose and relative size, is text to be <em>seen</em> first, and <em>read</em> second”.</li></ul><blockquote>[…] In other words a picture of text. When it comes to pictures, you are likely to scale all scene-setting imagery — cover photos, hero images, and so on — relative to the viewport. Take the same approach with display text: lock the size and shape of the text to the screen or browser window.</blockquote><ul><li><strong>Consistent line length.</strong> It’s widely known that there exists an optimal line length (measured in words or characters) for comfortable reading. Line length can be unpredictable at different screen widths for text whose size is static.</li></ul><p>Viewport-relative sizing easily addresses both of these concerns<a href="#cd2f">²</a>. It’s worth pointing out, though, that while it’s probably the obvious solution for setting display text (unless you’re happy with JavaScript), it’s by far not the only alternative for achieving consistent line length. In addition to good old media queries to control text container sizing<a href="#4225">³</a>, you can also <a href="https://caniuse.com/ch-unit">use the </a><a href="https://caniuse.com/ch-unit">ch unit</a> to specify a max-length for a block of text. Ultimately, don&#39;t forget that on screens, <a href="https://www.smashingmagazine.com/2014/09/balancing-line-length-font-size-responsive-web-design/">there is a relatively wide range for line length where reading comfort isn&#39;t compromised</a>, and it&#39;s not necessarily tied to text size.</p><blockquote>When designing a responsive website, start with a comfortable font size and an ideal measure to help determine break points. But when the time comes (as it always does), let the ideal measure go.<em> (</em><a href="https://www.smashingmagazine.com/2014/09/balancing-line-length-font-size-responsive-web-design/"><em>Smashing Magazine</em></a><em>, 2014)</em></blockquote><h3>A note on accessibility</h3><p>Allowing people to retain control over the font size displayed in their browser is one of the most basic of accessibility requirements. Matej Latin thoroughly compared the pros and cons of different fluid type approaches in <a href="https://betterwebtype.com/articles/2019/05/14/the-state-of-fluid-web-typography/">The State of Fluid Web Typography</a>, and many of them feature issues of accessibility. As mentioned above, it <em>is</em> possible to make fluid typography accessible by combining viewport units with rem or em (preferably rem)—this ensures text zooming is functional and that the browser&#39;s default font size is respected.</p><p>Still, Latin’s line of thinking resonates with me:</p><blockquote>We shouldn’t be focusing on making our font sizes scale nicely for every screen width. We should make our texts easy and enjoyable to read to each and every one of our users. This means leaving some of the control over web typography in their hands. At this moment, fluid web typography interferes too much with that.</blockquote><p>This rings true even for fluid type that ticks the accessibility boxes. It’s especially relevant when laptop/desktop users resize their browser—more on that later.</p><p>I’d be very interested to hear of more readability-related cases for or against fluid text sizing. As it stands, I’m not convinced there is a strong argument.</p><p>Next, let me shift focus from the text itself to the interface as a whole. Can the extent to which fluidity is applied create unexpected usability issues?</p><h3>Fluid type or fluid interface?</h3><p>Similarly to readability, <em>how much</em> of the content on your site should scale fluidly is something I rarely find discussed. Perhaps you consider fluidity important only for display text, as suggested above; maybe it’s all the body copy so that you can maintain consistent line lengths. There’s the option of making type fluid only on handheld devices, where there’s less room for drastic layout changes across sizes<a href="#a44a">⁴</a>.</p><p>I’m keen to hear if there are best practices here that I’ve missed, but it seems to me that applying fluidity anywhere can easily trickle down to the entire interface (especially if the aim is to have fewer breakpoints). Having scaled the font size, you need to scale line heights and spacing around elements. But most interface elements contain some text; you go around adding a vw here, a vmin there, and suddenly the majority of your interface is fluid.</p><p>At the extreme, this can result in a design that scales fully proportionally and maintains its aspect ratios everywhere. It’s as if you’re looking at a picture of a website, not a live interface.</p><p>Common sense says that most uses of fluidity will fall somewhere in the middle of that spectrum. Still, it’s interesting to speculate on how full fluidity might end up harming usability.</p><h4>Resizing windows</h4><p>Everyone resizes their windows. Your site’s visitors are probably not doing it to scrutinise your responsive design, but there may be other, very practical reasons at play.</p><p>I make a window bigger when I want to see <em>more</em> information, not <em>the same</em> information presented in a larger size. A reason for making windows smaller might be wanting to fit multiple windows next to each other and work with all of them simultaneously (think task-based workflows such as editing in one window and viewing references in another). I have no data to back this up, but my intuition says that it’s the amount of available space, not the size of visible content, that people are playing with when they resize windows.</p><p>When I imagine a fully fluid interface, I’m reminded of how Frank Chimero describes <a href="https://frankchimero.com/blog/2015/the-webs-grain/">edgelessness</a> as a core characteristic of designing for the web. A fully fluid interface will stubbornly stick to its edges, choosing to scale its content instead of adjusting its layout. To me, this feels annoying in the same way that scrolljacking feels annoying. To use Chimero’s terms, it goes against the grain.</p><p>Taking a step back—as mentioned before, using viewport-relative units for just your text and scaling the whole design proportionally are very different things. But in all cases it’s worth considering for a moment how and whether people expect content to scale during resizing. Browsing a blog? It probably doesn’t matter. Referencing a dense data table while working in a separate window? Maybe don’t go crazy with fluidity.</p><h4>One (fluid) size fits all</h4><p>I’m verging on the hypothetical now, but for the sake of argument, here’s a final thought on how excessive fluidity in interfaces can negatively impact UX: the loss of pressure on developers to adapt the design.</p><p>If things scale proportionally and line breaks stay where they ought to, everything technically looks great on a wide array of screen sizes. At the extreme, you might get away with separate mobile and desktop layouts, with everything in between relying on fluidity.</p><p>But this goes back to the previous point about people wanting to see more content, not the same content bigger. The extra space afforded by larger screens should be seen as an opportunity to adjust the layout so the viewer can take full advantage of their screen real estate. Conversely, on small screens, with a fluid interface you can <em>juuuuust</em> push at the boundary of what’s acceptable, because everything fits, after all.</p><blockquote>How large should images be? When does the site look awkward &amp; disjointed? When do things get too large? Is it appropriate to slide this layout’s columns out into additional sidebars […]?<em> (</em><a href="https://trentwalton.com/2012/06/19/fluid-type/"><em>Trent Walton</em></a><em>, 2012)</em></blockquote><p>It’s not that anyone would purposefully neglect responsive design. But it does become easier for things to count as passable. At the very least, subtly adjusting designs for many screen sizes (“tweak till you’re cross-eyed”, in Walton’s words<a href="#4225">³</a>) is an outlet for creativity and craftsmanship, and it would be a shame to start seeing less of that.</p><p>To recap: I explained why fluid font sizing isn’t inherently better or worse for UX, aside from a couple of minor, specific areas. I also speculated on how excessive fluidity can become problematic. Many of the issues raised are subtle, but I wanted to raise them nonetheless and add to what otherwise feels like a developer-centric discussion.</p><p>Personally, I’m happy to stay with responsive approaches for now. I do want to make a point of endorsing fluid type and its simplicity: it’s a clever technique that when thoughtfully implemented can create beautiful typography that scales exactly where you want it to, challenging the view that dimensions on the web should be fixed. But as it stands, I’m not convinced the value added is worthwhile.</p><h4>Footnotes</h4><ol><li><a href="https://vycke.dev/blog/fluid-interfaces-using-css/"><em>Fluid interfaces using CSS</em></a><em> by Kevin Pennekamp, 2020<br></em><a href="https://pixelgrade.com/upstairs/creating-true-fluid-web-typography/"><em>Creating true fluid web typography to improve our processes</em></a><em> by Razvan Onofrei, 2020<br></em><a href="https://zellwk.com/blog/changing-modular-scale/"><em>Changing Modular Scale Ratio at Different Breakpoints</em></a><em> by Zell Liew, 2016</em></li><li><a href="https://css-tricks.com/viewport-sized-typography/"><em>Viewport Sized Typography</em></a><em> by Chris Coyer, 2012<br></em><a href="https://24ways.org/2016/responsive-display-text/"><em>Get the Balance Right: Responsive Display Text</em></a><em> by Richard Rutter, 2016</em></li><li><em>I cite Trent Walton’s 2012 article, </em><a href="https://trentwalton.com/2012/06/19/fluid-type/"><em>Fluid Type</em></a><em>, a few times here. Among other things, I think it includes a lovely, step-by-step description of the traditional responsive, breakpoint-based, approach to getting line lengths perfect. His thoroughness shows a real respect to viewers, which is a part of why it’s somewhat bittersweet to see more pragmatic, one-size-fits-all solutions becoming popular.</em></li><li><em>The design is usually the same across mobile phones, so making the type proportional to other elements leaves less room for surprising edge cases. I haven’t seen this idea of fluidity only on smaller screens toyed with, but I personally think it’s something worth exploring (</em><a href="https://www.munnelly.com/webdev/responsive-web-design-fluid-typography.html"><em>this article</em></a><em> cites laptop sizes as “popular choices” for the maximum screen widths where fluidity is applied, but it’s unclear whether that means fluidity on larger screens is unpopular; Razvan Onofrei </em><a href="https://pixelgrade.com/upstairs/creating-true-fluid-web-typography/"><em>also hints at</em></a><em> laptop screen sizes being the boundary for fluidity, but, again, it’s not made explicit).</em></li></ol><p><em>Originally published at </em><a href="https://elisehe.in/2021/03/13/fluid-type"><em>https://elisehe.in</em></a><em> on March 13, 2021.</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/94/0*IPsLCe43SRBBM8zc" /><figcaption>The UX Collective donates US$1 for each article published on our platform. This story contributed to <a href="https://www.bayareablackdesigners.com/">Bay Area Black Designers</a>: a professional development community for Black people who are digital designers and researchers in the San Francisco Bay Area. By joining together in community, members share inspiration, connection, peer mentorship, professional development, resources, feedback, support, and resilience. Silence against systemic racism is not an option. Build the design community you believe in.</figcaption></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f7f32f0d37a3" width="1" height="1" alt=""><hr><p><a href="https://uxdesign.cc/why-should-type-be-fluid-anyway-f7f32f0d37a3">Why should type be fluid, anyway?</a> was originally published in <a href="https://uxdesign.cc/">UX Collective</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Some image magick]]></title>
            <link>https://elisehein.medium.com/some-image-magick-60ca8ffb8c76?source=rss-c69278bc3913------2</link>
            <guid isPermaLink="false">https://medium.com/p/60ca8ffb8c76</guid>
            <category><![CDATA[imagemagick]]></category>
            <dc:creator><![CDATA[Elise Hein]]></dc:creator>
            <pubDate>Thu, 04 Feb 2021 00:00:00 GMT</pubDate>
            <atom:updated>2021-03-25T18:09:37.621Z</atom:updated>
            <content:encoded><![CDATA[<p>I recently started an epic photo album project chronicling our family life from the last decade. It included putting together a system that allows me to quickly pick and print photos on a monthly basis so that I don’t ever again end up with years’ worth of curation work to tackle.</p><p>I’m a sucker for laying stuff out neatly, and for once got a chance to do it in the physical world. I thought it would be nice to have photos appear in various different sizes, so each album page is a bit like a collage of bigger “key moments”, and smaller, peripheral “vibe moments”.</p><p>Unfortunately I found no local print shops that print photos smaller than the standard 10x15cm. For real?!</p><p>So, here are two tiny imagemagick scripts to take a bunch of photos in the working directory and output collages in a 2x2 or 2x1 grid (which I then print in the standard 10x15 format).</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/82a8d584ffd58abbc8306b5dd7d97ede/href">https://medium.com/media/82a8d584ffd58abbc8306b5dd7d97ede/href</a></iframe><p>It turned out to be trickier than I imagined, because you need to account for photos being landscape or portrait in order to correctly slot them into a quarter or a half of the standard photo size.</p><p>The sizes for a quarter (1902x1267.5) and half (1902x2535) are kind of arbitrary, and chosen to be big enough to look good when printed in the 10x15cm format.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/853/0*lZoiX0goNcWOVqVP.png" /><figcaption>Example result of running montage-half in a folder with five Unsplash photos</figcaption></figure><p>Now, after sorting a handful of photos into folders based on whether they should be a half or a quarter of the standard, I just run the two scripts and end up with a collection of photos in the same size, some collages, some not, ready for printing in batch.</p><p>Yes, I do have to manually cut them after printing. Yes, I did buy a guillotine cutter.</p><p><em>Originally published at </em><a href="https://elisehe.in/2021/02/04/imagemagick-magic"><em>https://elisehe.in</em></a><em> on February 4, 2021.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=60ca8ffb8c76" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[iCloud, Dropbox, symbolic links]]></title>
            <link>https://elisehein.medium.com/icloud-dropbox-symbolic-links-80fc759adc20?source=rss-c69278bc3913------2</link>
            <guid isPermaLink="false">https://medium.com/p/80fc759adc20</guid>
            <dc:creator><![CDATA[Elise Hein]]></dc:creator>
            <pubDate>Sun, 27 Mar 2016 19:05:00 GMT</pubDate>
            <atom:updated>2021-02-14T13:51:11.397Z</atom:updated>
            <content:encoded><![CDATA[<p>I love Dropbox, but I was never a fan of having to keep my files inside that “magic folder” of theirs. The home directory is where my top-level directory structure should be rooted to, whether I want something in the cloud or not.</p><p>The solution — symbolic links. I was skeptical whether they would work the first time it occurred to me, but I’ve encountered no issues. Ever since, my local Dropbox folder has been a neat reflection of a list of directories I want backed up, which only take up <a href="http://unix.stackexchange.com/a/2929">a few bytes of space for the name, the pointer reference, and some other metadata</a>. Add Selective Sync, and you’ve got an order-lovers dream.</p><p>My set up recently passed the ultimate test when That Thing You Think Will Never Happen To You happened to me. I had been working on a Keynote file all day, did a final review, exported it into PDF, and out of nowhere, all of my work was gone. The newly exported PDF contained the version from around four hours earlier, and the same was the case with the Keynote file.</p><p>I ignored my heart sinking (the deadline was a few hours away) and told myself it must’ve been a silly slight of hand: Cmd+Z Cmd+Z - nothing. Cmd+R? No newer versions; none in the revert history either. Wait, doesn&#39;t OS X ship with that Time Machine thingie? &quot;To set a location for backups, please set up Time Machine&quot;. Shitshitshit.</p><p>Obviously I had been periodically saving the Keynote file. I was also storing it on iCloud Drive. I don’t normally use iCloud, but in this case I wanted the .key file to be synced to my iPad. Sweet, I <em>must</em> be able to restore my work from iCloud, right? Nope — the latest version there was also from four hours earlier.</p><h3>“Previous versions”</h3><p>Funnily enough, it didn’t actually occur to me until later when I was getting ready to burn the midnight oil that my coursework folder was symlinked to Dropbox. I suppose that’s one negative side effect of not using Dropbox as the actual root for your files: you tend to forget that it’s there. I had also never intended to use it as a version control service (I’ve always seen it more as external storage) but there it was, that wonderful menu item titled “Previous versions” which listed minute-by-minute changes to my Keynote file, including that four hour gap that had somehow slipped past iCloud.</p><p>I’m still not sure how my work disappeared — it was late and I was relieved to wrap things up. The one feasible explanation I can come up with is that at some point four hours earlier I must have accidentally abandoned working on the iCloud version, and made all new changes on a local file instead; I then <em>somehow</em> overwrote the local copy with the older iCloud version. This would explain the situation I ended up in, but I can’t quite conceive the exact chain of events required to get there: all I did was export my Keynote to PDF.</p><p>As a technically aware computer user, what I take away from this is heightened paranoia towards ensuring I back up my work, and increased attention to where I store it and how I save it. As a layperson and consumer of cloud storage solutions, I don’t much care where I went wrong or whether it was my fault — I expect these services to anticipate and fix my mistakes. Judging by that, I will happily carry on paying Dropbox £7.99 a month; when it comes to iCloud, first impressions matter, and mine resulted in an air of lasting skepticism.</p><p><em>Originally published at </em><a href="https://elisehe.in/2016/03/27/dropbox-symlinks"><em>https://elisehe.in</em></a><em> on March 27, 2016.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=80fc759adc20" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Fruit flies like a banana]]></title>
            <link>https://elisehein.medium.com/fruit-flies-like-a-banana-c20d8505ee5c?source=rss-c69278bc3913------2</link>
            <guid isPermaLink="false">https://medium.com/p/c20d8505ee5c</guid>
            <category><![CDATA[language]]></category>
            <category><![CDATA[naturallanguageprocessing]]></category>
            <dc:creator><![CDATA[Elise Hein]]></dc:creator>
            <pubDate>Sat, 26 Dec 2015 11:27:00 GMT</pubDate>
            <atom:updated>2021-02-14T13:46:25.925Z</atom:updated>
            <content:encoded><![CDATA[<p>The go-to example to illustrate ambiguity in any introductory natural language processing course is <em>Time flies like an arrow</em>. I never realised just how ambiguous the sentence actually is before coming across this passage in Steven Pinker’s <a href="https://www.goodreads.com/book/show/5755.The_Language_Instinct">The Language Instinct</a>:</p><blockquote><em>Computer parsers are too meticulous for their own good. They find ambiguities that are quite legitimate, as far as English grammar is concerned, but that would never occur to a sane person. One of the first computer parsers, developed at Harvard in the 1960s, provides a famous example. The sentence </em>Time flies like an arrow<em> is surely unambiguous if there ever was an unambiguous sentence (ignoring the difference between literal and metaphorical meanings, which have nothing to do with syntax). But to the surprise of the programmers, the sharp-eyed computer found it to have five different trees!</em></blockquote><blockquote>1. Time proceeds as quickly as an arrow proceeds. (the intended reading)</blockquote><blockquote>2. Measure the speed of flies in the same way that you measure the speed of an arrow.</blockquote><blockquote>3. Measure the speed of flies in the same way that an arrow measures the speed of flies.</blockquote><blockquote>4. Measure the speed of flies that resemble an arrow.</blockquote><blockquote>5. Flies of a particular kind, time-flies, are fond of an arrow.</blockquote><blockquote><em>Among computer scientists the discovery has been summed up in the aphorism “Time flies like an arrow; fruit flies like a banana.”</em></blockquote><p><em>Originally published at </em><a href="https://elisehe.in/2015/12/26/fruit-flies-like-a-banana"><em>https://elisehe.in</em></a><em> on December 26, 2015.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c20d8505ee5c" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>