Full Width [alt+shift+f] Shortcuts [alt+shift+k]
Sign Up [alt+shift+s] Log In [alt+shift+l]
SplitDuck.com Use A/B testing to increase revenue
120

I'm shutting down my job tech jobs board after two-and-a-half years

from The Pragmatic Engineer [alt+shift+b] in programming

I started The Pragmatic Engineer Job Board in October 2021. 2.5 years later, I am shutting it down permanently, despite a reasonable success in traction. The shutdown was triggered by my vendor – Pallet – discontinuing their job board and talent collective approach. However, I might have eventually come
9th Apr 2024

Stay updated

Get a weekly newsletter with the top 5 articles worth reading every week.

More from The Pragmatic Engineer

The Pulse: Is Amazon’s writing culture collapsing because of AI?

A former Amazon engineer sees signs that the ‘six-pager’ documents used to promote good decision making are increasingly AI-generated and AI-read, and warns it’s not a positive development.

10 hours ago • 1 votes
The Pulse: Details of incident.io’s AI spend

The resiliency startup has slashed the amount it spends on AI; down from $4,500 per dev, per month, in August, to $1,600 now.

3 weeks ago • 1 votes
The Pulse: RoR creator sparks new “death of coding by hand” debate

In his Rails World keynote, David Heinemeier Hansson (DHH) declared the end for writing code by hand for professional work – at 37signals at least. Is this change now unstoppable?

1st Oct 2026 • 1 votes
How software engineering is changing: an essay challenge

The pace of change in software engineering is only accelerating, especially since January of this year. This is all to do with the industry-wide adoption of LLMs, AI tooling, and AI infrastructure. At The Pragmatic Engineer, we always want to capture as much of what’s going on

1st Sep 2026 • 1 votes
The Pulse: Bending Spoons' Acquisition Strategy

In only 5 years, Hopin went from zero to a $7.7B valuation, and back to zero again. Also: Bending Spoons’ startup acquisition model.

5th Aug 2026 • 1 votes

More in programming

Hidden until found

by Roy Keur The hidden attribute has always been an odd way of hiding elements. It allows a developer to hide elements with HTML and this by itself has been a source of debate since it was introduced. A couple of years ago, this attribute was already discussed over here, but what has been predicted as the future has turned into a reality today. hidden is no longer truly hidden since the introduction of until-found as a new value for this attribute. From the beginning, we were promised in the specs that when you add hidden to an element, you make it hidden from all presentations. Since until-found has been implemented, I feel a bit lied to, as this new value seems to break that promise. I would say it is a good idea to revisit this nefarious attribute to see what has actually changed and what we can learn from it. Hiding important content with display:none (and hidden) has shortcomings Let's start with a brief reminder of why hidden="until-found" was introduced in the first place. The very basics are that hidden applies display: none to an element, as defined in the user agent stylesheet, but using display: none can lead to some shortcomings. Some years ago, various news media found it a good idea to cut stories on their websites in two parts by inserting a 'Continue reading' button at some point in their articles, especially on mobile devices. Below is a simplified snippet of how this concept is applied today: <p> You could either take a boat or fly to Lorem Ipsum Island, but the flights are all cancelled due to a lack of available aircraft, so you will have to take a boat. </p> <button type="button" aria-expanded="false"> Continue reading this article </button> <p data-readmore-hidden="1" style="display: none;"> You can either use a catamaran, which takes one hour and fifteen minutes with departure time at 11:30, or take the slower cruise ship which takes two hours and 30 minutes, with departure time at 9:30. </p> Note: the original code in this snippet uses display: none, not hidden, and I have retained this. In the chapter about the specs later on, I will discuss why display: none might indeed be a better choice than hidden in this context. If you want to search for "departure time" in this snippet, you have got two choices: either read the whole article or use the in-browser find-in-page functionality that can for instance be triggered by pressing CMD+F or CTRL+F on a keyboard. If you try to use find-in-page, however, you will get zero (0) results. Why? If you hide content with display: none, you render it not only invisible and inaccessible to the user, but also to the user agent and that is what tries to search for any matches. What also will not work with hidden content is linking to a page anchor (think of website.test/some-page#paragraph-1) and using text fragments in the URL to highlight text (think of website.test/some-page#:~:text=departure%20time). How hidden="until-found" fixes these shortcomings To make hidden content searchable by the user agent, we can now use hidden="until-found", which uses content-visibility: hidden instead of display: none. By using content-visibility, the element keeps its box, but its contents are not rendered, and the browser retains its state (for example, scroll positions) instead of throwing it away like display: none does. It allows a browser to tell content that should really be hidden apart from content that is hidden but should still be searchable. Note: just using content-visibility on an element by itself does not make the element searchable. Using hidden="until-found" does. Also, it is worth mentioning that using until-found still does not make content available to screen readers: hidden is meant to hide content from all presentations (see below) and a user agent is not a presentation. In practice, hidden="until-found" works like this: when a user searches for a term with find-in-page or text fragments, the browser searches through all searchable content. In case of a match, the browser triggers an associated beforematch event on the element that contains the match and hidden="until-found" will be removed from the element, before scrolling to the newly revealed match. The removed attribute will not be re-added to the element, even when closing find-in-page, so the element will not be hidden again in the currently active browser session. Notes on what specs state about hidden The specs state the following about the hidden attribute: "if something is marked hidden, it is hidden from all presentations, including, for instance, screen readers". It is fairly strict on what you should use hidden for. Using hidden on elements that "could legitimately be shown in another presentation" (for example, in a tabs pattern) is deemed 'incorrect' because "the tabbed interface is merely a kind of overflow presentation", explaining you could "equally well" have "one big page with a scrollbar". I tend to agree with the principle of this statement from a vision of "(information on) the internet should be available to all" and "important information should not be hidden anyway", but what if when we do want to temporarily hide content? We should apparently not use hidden, but should we also not use display: none since that is essentially what hidden does? That would be strange, as we all use display: none to hide elements in all kinds of use-cases, such as this previous snippet, but also accordions, tabs, header navigation menus, etc. Even a closed native <dialog> uses display: none internally. Is that supposed to be different, then? The mysterious Hidden state Interestingly, the specs also state (no pun intended) this: "User agents should not render elements that are in the Hidden state". This state is what sets hidden apart from display: none semantically: applying display: none to an element does not give an element the Hidden state. This Hidden state is only relevant for the browser, as it is the browser that uses this state to determine the relevance of the content. A user will not notice the visible difference between hidden and display: none. There can be cases, however, where states do get relevant for the user. I will talk about such a case in the final chapter of this article. So, elements with the hidden attribute get the Hidden state, but didn't until-found explicitly enable user agents to actually make elements visible? Perhaps surprisingly, elements with hidden="until-found" do not get the Hidden state. Instead, a special Hidden Until Found state is introduced, which allows an element to be accessible to find-in-page and fragment navigation, although conditionally an element "needs to be affected by layout containment" (essentially if display is not none, contents or inline). It appears hidden="until-found" is more different from hidden than I thought. Comparison with <details> hidden="until-found" works similarly to <details>. Both use content-visibility to hide content. However, <details> was not meant to work like this when it was introduced. Its original purpose was simply to allow a user to toggle the visibility of content without having to resort to using JavaScript or CSS and its original implementation worked with a display: none toggle too. Only when content-visibility arrived in browsers was display: none replaced by it. Notable differences to hidden="until-found" are that you will be able to collapse <details> natively after a match has caused it to expand and <details> has user interface additions like a (native) marker, suggesting there is hidden content to expand, while hidden="until-found" does not give any visual clues. An accordion use-case with hidden="until-found" Let us make an accordion where we can search in collapsed content, using hidden="until-found". As a base, we can take this Accordion Example in the ARIA Authoring Practices Guide. That example already makes use of hidden="" – the attribute the specs kind of told us not to use here! – to hide content, so to make the content available for find-in-page is as simple as adding until-found as a value to that same attribute. Consider the following HTML snippet, where JavaScript has been omitted for brevity: <div id="accordionGroup" class="accordion"> <h3> <button type="button" aria-expanded="false" class="accordion-trigger" aria-controls="sect1" id="accordion1id"> <span class="accordion-title"> Some title <span class="accordion-icon"></span> </span> </button> </h3> <div id="sect1" role="region" aria-labelledby="accordion1id" class="accordion-panel" hidden="until-found"> Some hidden content. </div> </div> Here we manage to more or less replicate <details>, as we can expand the content by searching inside the hidden content, while also being able to collapse it, but there are notable differences. Firstly, headings keep their semantic meaning consistently. <details> has a limitation Scott O'Hara elaborates on in more detail, but the core issue here is that when you place a heading inside the compulsory <summary>, browsers and screen readers could interpret this heading as presentational, which messes up the intended semantics of the page. Secondly, we do need JavaScript to control the visibility state of the content and the state of aria-expanded. Using JavaScript allows us to let hidden="until-found" truly shine here, as we can listen for the beforematch event to fire and use that to toggle the visibility state. Interestingly, just like how you can't just place content-visibility: hidden somewhere and an element will be searchable for the user agent, you cannot just place a beforematch event listener on an element with visually clipped content and expect it to fire. You must use hidden="until-found" for this to work. About browser support Chromium has shipped hidden="until-found" since 2022 (Chrome 102), Firefox followed in February 2026 (Firefox 148), and Safari 26.2 (December 2025) shipped it as well, together with the beforematch event. Safari's support still counts as partial because it does not yet scroll to the revealed match (WebKit bug 304174). If a browser does not support until-found, it falls back to using display: none, as if it were a plain hidden attribute, which makes this a neat progressive enhancement. Instead of using the regular fallback, I would rather show the content by default by applying display: block. The same principle applies when JavaScript is disabled, except here we need to additionally declare content-visibility: visible. With JavaScript disabled, consider hiding the toggle button too, as the content will be visible anyway. Nowadays applying CSS when JavaScript is disabled is easy, since @media (scripting: none) is widely available. A cursed thought experiment In case <details> is not a viable option, we need to use JavaScript and that means a screen reader user will need to use a button to toggle the visibility of hidden content, whether it has until-found or not. There are ways to work around this need to toggle. I have come up with a cursed way of implementing hidden="until-found" by actually not hiding its contents by default. Consider this CSS snippet: [hidden='until-found'] { content-visibility: visible; display: block; contain: strict; contain-intrinsic-height: 1px; } Some key points here: content-visibility: visible is applied to override the default browser implementation of hidden="until-found"; display: block is applied to override any odd [hidden] { display: none } in case of a normalise/reset file; contain-intrinsic-height must be at least 1px, as otherwise NVDA or the in-browser speech functionality will not announce the hidden content. Compared to a regular accordion where you deliberately hide content and render it inaccessible, here, the mindset is the opposite. Content is accessible by default, albeit visually hidden; it is accessible to screen readers without the need to toggle (I was able to verify this with recent versions of VoiceOver, NVDA and JAWS); one can browser-search within the hidden content; one can interact with interactive elements (links, buttons) within the hidden content and by adding a focusin event listener, you can even toggle the visibility state when a user focuses on such an item. Below is a snippet that implements this experiment. It is simplified to leave only the relevant parts in, including a minimum bit of JavaScript to make the toggle work both on click (on the button), on beforematch and on focusin. See the Pen Hidden until-found in use as an accordion by Roy (@roye7777777) on CodePen. There is much to think of here, but there are a few things I want to mention. The toggle button is still present, even when the visually hidden content is accessible to screen readers. It will still toggle the visibility. For screen reader users, this makes no difference, since all content is readily available to them. To then still find a button that suggests an element is still collapsed, while it actually is not, is wrong and one reason not to use this altogether. You could try to hide the button from screen reader users, but there is not much you can do, really. Applying aria-hidden="true" onto a button is wrong as hiding a focusable element from assistive technology is an accessibility failure in itself. Also: what would happen if you use a screen reader in combination with a magnifier? Content could probably be announced, but the user would not be able to see where this text is coming from, since it is visually hidden. Although it is not uncommon to see this in practice (particularly in these 'read more' articles), it is potentially confusing. Final notes on reader mode There's one more thing I mentioned earlier in this article that I want to discuss, and it is the Hidden state. Browsers have a reader mode functionality these days, and their intention is to make content-heavy articles easier to read with less noise. Those who have been testing with this know that reader mode in each browser behaves differently. Each browser engine has a different implementation of this non-standardised concept, and their specific rules and guidelines are often undocumented. Unlike print or noscript, there is not something like a media query to override a certain undesired state within reader mode and I suppose this restrictiveness is intentional to keep it as clean as possible (read: to prevent developers spamming reader mode with noise anyway). Rules of thumb for reader mode are generally: let the HTML be semantically correct, have enough content for reader mode to become active, and most importantly in this context: any hidden content will stay hidden. Any element with the hidden attribute set, even with until-found as its value and even when overridden with display: block, will always be hidden in reader mode. To me, when using specifically hidden="until-found" and <details>, this principle feels wrong. I expect content in hidden="until-found" and <details> to be visible in reader mode. Yes, these elements are hidden, but they all can natively become visible and that ability, together with this special so-called Hidden Until Found state, has been implemented in browsers for a reason after all! Why would in a group of <details> all <details> be hidden except for the first as it contains an open attribute? I hope this behaviour will change in browsers in the future, or at least there will be an option where one can express a desire to show a collapsible element in reader mode. So, important to remember here is this: if you were to use hidden="until-found" in a content-heavy article, you deny users the ability to read all content in reader mode. There is no way to work around this without resorting to duplicating content and rendering it invisible differently by means of opacity: 0, clipping, positioning it out of view or whatever nonsense, as then this duplicated content is semantically not hidden. Now that is hell!

3 hours ago • 1 votes
The Pulse: Is Amazon’s writing culture collapsing because of AI?

A former Amazon engineer sees signs that the ‘six-pager’ documents used to promote good decision making are increasingly AI-generated and AI-read, and warns it’s not a positive development.

10 hours ago • 1 votes
Jenni joins Digital Science: a four-year retrospective

In October 2026 Jenni was acquired by Digital Science. A personal reflection on four years as founding designer, from $4k to $730k in monthly revenue.

yesterday • 1 votes
counting large numbers of events in small floating point registers

In 1978, the ACM published an algorithm by Robert Morris for counting large numbers of events in small registers. It uses one byte to keep track of the approximate logarithm of the count, and randomly increments the logarithm with a probability that scales with the value of the count. You can tune the range and precision of the counter by adjusting the base of the logarithm. Morris suggests pre-calculating a table of probabilities so that no difficult calculations are needed at runtime. Recently I learned from emsenn about a 2009 paper by Miklós Csűrös titled approximate counting with a floating-point counter. It changes Morris’s algorithm to use a binary log-linear counter instead of a pure logarithm. It reminded me of my hg64 log-linear histograms, so I thought it would be fun to implement, especially since the algorithm can be made shorter and faster. representing a counter We need to choose the number of bits to use for the exponent and mantissa of each approximate floating point counter. Typically the exponent will be 5 or 6 bits, corresponding to an unpacked exact counter of 32 or 64 bits. The mantissa will typically be the rest of an 8 or 16 bit integer (though languages such as Zig and C23 allow more adventurous integer sizes). I’ll call the approximate counter type usmol and the unpacked counter type ubig. #define EXPBITS 5 #define SIGBITS 3 typedef unsigned _BitInt(EXPBITS+SIGBITS) usmol; typedef uint32_t ubig; static_assert(sizeof(ubig) * 8 == 1 << EXPBITS, "ubig must match EXPBITS"); It’s straightforward to extract the exponent and mantissa from a usmol counter. Unpacking a usmol into a ubig is slightly tricky. Like hg64 and IEEE754, normal numbers (with a nonzero exponent) have an implicit leading bit, and denormal numbers (exponent is zero) do not. The effect is that small counts are represented exactly in a usmol (up to 2*MANTISSA, covering denormal numbers and exponent == 1), and larger counts are shifted by the exponent. (I don’t need the inverse conversion here, but it is used by hg64 to map a sample to a histogram bucket, truncating the value by shifting right.) #define MANTISSA (1 << SIGBITS) static inline ubig exponent(usmol approx) { return(ubig)(approx / MANTISSA); } static inline ubig mantissa(usmol approx) { return(ubig)(approx % MANTISSA); } static inline ubig unpack(usmol approx) { ubig e = exponent(approx) - 1; ubig m = mantissa(approx) | MANTISSA; return(approx < MANTISSA ? approx : m << e); } bumping a counter Because binary floating point uses logarithms in base 2, we need the probability of incrementing the counter to scale with 2^-e. Specifically, we want the probability of increasing the counter to be 100% when its exponent is 0 or 1, 50% when the exponent is 2, 25% when it is 3, etc. Csűrös does this by getting a random bit e times in a loop and incrementing the counter if they are all zero. A more efficient way to do this on a computer is to get a ubig word full of random bits and count the leading or trailing zeroes. There are a variety of bit scan functions that differ in how they number bits and what they do when the word is entirely zero. The POSIX ffs() family has the advantage of no undefined behaviour, but it weirdly counts from one. However this oddity turns out to match the way denormal numbers give our exponent an off-by-one bias. So for instance, when our exponent is 2 and we want a 50% probability, we want ffs() to return 2 or more. OK, that determines when to increment the mantissa given a particular exponent. But how does the exponent get incremented? Like Csűrös, we put the exponent immediately to the left of the mantissa; when the mantissa overflows, it rolls over to zero and the exponent ticks up. No special cases are needed. The resulting code is short: usmol bump(rng_t *rng, usmol approx) { ubig r = ubig_random(rng); ubig z = (ubig)ffsll((long long)r); ubig e = exponent(approx); return(approx + (z >= e)); } considerations Morris allows you to smoothly tune the allowable range and precision of a counter by adjusting the base of the logarithm. By contrast, Csűrös has very lumpy 2^2^n choice of ranges; that isn’t necessarily bad because it’s normal for programmers to have to choose between uint32_t and uint64_t. Morris uses a lookup table to determine the probability of incrementing, which is tolerable for an 8 bit counter, but it can get large for wider counters. Csűrös just uses a few instructions and bigger counters don’t need much more. So I don’t think either algorithm is clearly better than the other, except that Csűrös has the winning fun factor of bithacking a bespoke floating point format.

2 days ago • 1 votes
How to tokenmaxx correctly

Parallelize discovery and execution, but serialize judgement.

2 days ago • 1 votes
📚 BoredReading

You seem to be enjoying this.

Join free to unlock everything.

Create free account

Already have an account? Sign in