logoalt Hacker News

kstenerud • today at 9:31 AM • 1 reply • view on HN

I was with them right up until the admonition against standardizing the UI components. This is not an all-or-nothing proposition. You build a standardized library incrementally, and you slowly migrate codebases over to use them. I've seen some pretty horrendous UI mish-mash in what should appear to be a single application, because each piece was done independently and then stitched together.

You end up with drifting implementations that may or may not come from the same root at different points, where the same fix has to be applied multiple times as each team learns the lessons for what not to do, etc. Effectively what DRY is about.


Replies

jillesvangurp • today at 9:50 AM

I got rid of about six years worth of technical debt on exactly this in our frontend last Friday. All it took was a few AI prompts. These types of issues are just melting away now.

Code duplication is fine as long the duplicates don't drift apart. Keeping them in sync is a bit tedious for people. And people tend to cut corners. So there's a potential to end up having to fix the same kinds of issues several times. But with AIs doing all the tedious work, staying on top of that is pretty doable. It's more a question of whether that's a good use of time and tokens. You could just make it fix things properly.

In the code base I mentioned, we had a few different component libraries that at some point were selected, used, and then later abandoned. We also had taken into use tailwind at some point but we never completed the upgrade to tailwind 4. And we had a bunch of manually styled html as well. It's an application with a lot of different functionality, lots of different screens, etc. So there was a bit of pressure to not break things. I fixed all of that in a few prompts. The application still looks and feels the same but is much more consistent in terms of look and feel (we had several varieties of buttons and input fields with subtly different behavior). We found and fixed a few minor issues since then.