I think we should change how we organize code a bit when programming with AI
Splitting code into small modules makes it easier for humans to read, but it gets AI lost, producing redundant code and endless bug-fix loops. Maybe it's time to organize code differently when working with AI.
Also in: Tiếng Việt · 中文 · 한국어 · 日本語
We used to try hard to split things into small modules so code was easier to read and components were more reusable.
But we need to understand that AI doesn't work like the human brain — it doesn't have a memory as good as ours yet. If you organize source code that way, AI has a pretty hard time finding components scattered across different places, so it ends up writing redundant code or getting stuck in a "cursed" bug-fix loop it can never escape.
Example: Tailwind and custom classes
I've seen some people use custom class names with Tailwind. That's an anti-pattern, especially when we're working with AI most of the time. A bunch of inline classes may look like a mess to us, but in reality AI can "read" all of them easily, left to right, top to bottom.
Locked section: The trade-off
The rest is for Knowledges members
Plus 1 more section (about 1 min) for members
You are reading roughly the first third. Knowledges, Combo and Community plans unlock paid articles in full; the Zuey AI plan reads previews only.