‹ BackHN Continuity

Thread

Once Claude can measure something, it can make it faster

231 points · 153 comments · matthieu_bl

  1. minimaxir · · focus · HN ↗
    This writeup legit coincidentally matches the asking-agents-to-make-code-faster-but-with-constraints-to-stop-agents-from-breaking-things writeup I posted on Monday: <a href="https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=49803085">https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=49803085

    Front-end UI optimization is slightly trickier than optimizing strict algorithms, but I found that prompts to the agents to build tooling to track visual regressions are more than sufficient. The main issue (at least with GPT models) is that you have to be very explicit about the use of padding&#x2F;margins&#x2F;negative space.

    That said, for my front end projects from scratch, I&#x27;m staying away from front-end JS frameworks and seeing how far and fast I can get with just HTML&#x2F;CSS&#x2F;vanilla JS shenanigans now that agents can wield them effectively.

    1. fy20 · · focus · HN ↗
      &gt; with just HTML&#x2F;CSS&#x2F;vanilla JS

      I was building web apps like this until 2017 when I entered the React + Typescript world. For B2B you can get pretty far, rendering HTML on the server is fast! I was using Rails on the backend, so templates, partials, shared chunks, made it easy to manage and have a consistent UI without repeating too much.

      The hard part is when you then need to build an infinite scrollable table, that has bulk select, and in-placs updating of columns. Ok maybe that&#x27;s a bit too extreme the other way, but when you get to the point where it&#x27;s easier to build full-on frontend components, you basically have to use a JavaScript framework for your entire UI. And they are basically all or nothing.

      Last time I checked (a good few years ago; I gave up and accepted un-optimized frontends as the rule) there wasn&#x27;t really a good way to do progressive ehancement like the above: the page rendered on the server as HTML, and some components then become fully frontend managed. And no, frameworks like Stimulus and HTMX don&#x27;t really solve it for me, I want something declarative.

      I&#x27;m a bit pissed off with DHH, that he went so far in the anti-Javascript direction, as IMO that was one of the big factors in Rails loosing it&#x27;s limelight status. For backend I still haven&#x27;t found anything as easy and fun to work with.

      1. EricFrost · · focus · HN ↗
        This seems like a good place to plug my own library, solarite:

        <a href="https:&#x2F;&#x2F;eric-frost.github.io&#x2F;solarite&#x2F;" rel="nofollow">https:&#x2F;&#x2F;eric-frost.github.io&#x2F;solarite&#x2F;

        I was also tired of the &quot;all or nothing&quot; of other libraries. Just let me import a js file and then make a class that&#x27;s a web component. I don&#x27;t want to setup a whole dang build environment.

        With Solarite you just write the markup as a javascript template, change your data however, and then call render(), where it only updates the DOM that should change.

        And you can use the component as a tag in your server-rendered page.

Open on Hacker News to reply ↗

Unofficial Hacker News client; not affiliated with Y Combinator.