Working with AI
The essay discusses how the creators of htmx and related projects use AI tools like ChatGPT and Claude for coding, debugging, and brainstorming. They find AI helpful for generating boilerplate code, suggesting solutions, and explaining complex concepts, but caution that AI often produces incorrect or outdated information and requires careful human oversight to avoid errors.
Background
- htmx is a JavaScript library that lets you build modern web apps using hypertext (HTML) returned from the server, instead of heavy client-side JavaScript frameworks like React or Vue.
- The essay's author, Carson Gross, is htmx's creator. He argues that AI code generators (like GitHub Copilot or ChatGPT) have a "React bias" — they default to generating complex JavaScript frameworks even when simpler HTML-based approaches would work better.
- The piece suggests a "20-year rule": AI training data mostly covers the last 20 years of web development (roughly 2004-2024), a period dominated by JavaScript frameworks. Older, simpler patterns like server-rendered HTML and htmx are underrepresented.
- This matters because developers using AI assistants may unknowingly produce overly complex, hard-to-maintain code, while simpler, faster alternatives exist but aren't well-represented in AI training data.