Hacker News new | ask | show | jobs
by phyzix5761 24 days ago
"Best Practices" are pretty much dead in the AI era. Pretty soon no one is going to read any of the code AI produces and that's a scary thought.
6 comments

IMO maintainability is the next frontier. If we just allow coding agents to accrete 1k-LOC solutions to problems, the codebases run quick away from our ability to maintain _some_ level of understanding.

So I'll take a 1-line CSS solution over 60 lines of ResizeObserver/setTimeout business. But.. best practices for frontend isn't just the code.. it's ensuring quality UX, that keyboard navigability works, that layout doesn't shift on users.

You just regenerate the codebase, like how you do a recompile in C. Writing code is 2026 is worth as much as writing machine code was in 1996.
I've not read text with such a high fraction of AI slop in a while. The heady days of a year ago.
Jesus! what a horrible idea!

Are you in the business of selling tokens/electricity/gpus by any chance? Then good for you!

But terrible for everyone else....

Yes, just like compilation was.
Once again, thank you for all the work you and the team have done to improve the web and the experience for developers working with it.
Best practices are not dead if they result in better user experience. The focus is less on developer ergonomics though - true that.
The "modern web primitives" are also not even necessarily the "best practice".

Browser-specific implementation gotchas tend to take about a decade to iron out for reasons that never have anything to do with code quality. Users are fickle and so are browser vendors, but that's a different topic.

At the end of the day, there's just no escaping lots of manual testing across device and browser combinations if your goal is a polished result and not just something that "works".

AI has done nothing to make this problem go away. If anything, it's made it worse because people don't even want to look at the code now!

Exactly.

I've recently finished a browser game specifically targeting an old iPad Air 1 we had lying around the house.

I had a working version after a weekend, but it took me a month to make it run smoothly on an over 10 years old mobile device. And the most recent browser available is almost 10 years old.

Surprisingly I didn't missed too many "modern" JS features, as these were mostly functional programming oriented which doesn't play well with optimization anyways, and the ES6 was more than enough as a programming platform.

Anyway, what I'm trying to say is that "the best practice" should be making your apps fast and accessible - as much as you can without having to sacrifice something you value - instead of chasing the latest and shiniest.

Don't be a fashion driven developer. :)

This is mostly best practices for making websites work better, not for pretty HTML.
>Pretty soon no one is going to read any of the code AI produces and that's a scary thought.

This is a misconception. Have your favorite agent summarize this video for you: https://www.youtube.com/live/zcLPGC-tvgk?si=YR68aHlFESD053bh

Ugh it is Uncle Bob, not going to torture AI with this guy.

But the fun part is that all of the proper software engineering practices are aimed at lowering amount of context a developer has to keep in his mind. So it directly applies to agent context. Less verbose code, less tokens to burn, separation of concerns, lower chance agent breaks something unrelated etc.

>>Pretty soon no one is going to read any of the code AI produces and that's a scary thought.

>This is a misconception. Have your favorite agent *summarize this video for you*: https://www.youtube.com/live/zcLPGC-tvgk?si=YR68aHlFESD053bh

I can't tell if you're joking here

I am not generally against using AI to reduce the amount of information you need to pay attention to, and I was not joking. There are multiple places in that interview with good articulation of the reasons why software fundamentals still matter, and what happens when you don't look at at least some of the AI-generated code.
> There are multiple places in that interview with good articulation of the reasons why software fundamentals still matter, and what happens when you don't look at at least some of the AI-generated code.

Sure, I've seen the video before and remember many of the arguments. I don't agree with everything in Bob's approach, but I certainly agree with what he says about the value of looking at the code.

But that doesn't at all mean that people will do it.

Why don't you just quote them then? Or quote whatever the LLM you used gave.
Uncle Bob Martin and Matt Pocock discuss the risks of relying on AI agents without human oversight, emphasizing that unchecked code can lead to significant technical issues:

   - Accumulated Technical Debt: Uncle Bob notes that agents often leave behind "dog doo" (messy code) (05:13-05:18). If you don't clean it, the code becomes progressively worse as you build on it (11:06-11:10).
   - Loss of Agent Coherence: When code quality degrades, agents struggle to maintain direction (11:13-11:16). They may enter a loop of inadvertently breaking existing features while attempting to fix new ones, eventually leading to them failing entirely or giving up (11:22-12:04).
   - The "Trapped" Trajectory: Matt Pocock highlights the risk of a session's "trajectory" (23:18-23:45). Without intervention, an agent's initial messy approach or misaligned focus will continue throughout the entire session, reinforcing poor patterns instead of correcting them (23:35-24:00).
   - Hidden Hallucinations: Even though agents are fast, they are still prone to hallucinations and misalignment (25:09-25:18). Relying on them blindly without deterministic tools or human spot checks risks incorporating silent, logic-breaking bugs into the architecture (09:08-09:19).
Your comment got flagged and killed; I don't know whether automated systems attempt to detect AI-generated comments. I vouched for you because the content was explicitly solicited.
just tell the AI to use best practices when writing code /s