---
title: "I think we should change how we organize code a bit when programming with AI"
url: "https://zuey.me/articles/toi-nghi-chung-ta-nen-thay-doi-mot-chut-cach-to-chuc-code-khi-lap-trinh-voi-ai?lang=en"
locale: en
access: members
full_text: false
published_at: "2024-12-18T01:44:43.000Z"
tags: ["Programming", "AI", "Perspectives"]
translations:
  vi: "https://zuey.me/articles/toi-nghi-chung-ta-nen-thay-doi-mot-chut-cach-to-chuc-code-khi-lap-trinh-voi-ai.md?lang=vi"
  zh: "https://zuey.me/articles/toi-nghi-chung-ta-nen-thay-doi-mot-chut-cach-to-chuc-code-khi-lap-trinh-voi-ai.md?lang=zh"
  ko: "https://zuey.me/articles/toi-nghi-chung-ta-nen-thay-doi-mot-chut-cach-to-chuc-code-khi-lap-trinh-voi-ai.md?lang=ko"
  ja: "https://zuey.me/articles/toi-nghi-chung-ta-nen-thay-doi-mot-chut-cach-to-chuc-code-khi-lap-trinh-voi-ai.md?lang=ja"
---
# 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.

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.

---

*Phần còn lại dành cho thành viên có quyền đọc toàn bài (Knowledges, Kết hợp, Cộng đồng) — see plans at https://zuey.me/pricing*
