Ask HN: AI Code Smells

4 dhr 4 8/21/2025, 10:45:58 PM
Just like AI text has tells like the em dash and certain phrases, what are some clues that code is AI generated?

Comments (4)

sky2224 · 13m ago
// Comments with first letter capitalized detailing something very obvious on each line.
raihankr · 6h ago
I think for AI-generated websites, they tend to use a lot of emojis for almost everything. Also, they use colorful and bright colors. Other indication is using a single HTML file for a page, with embedded CSS and JS. In my opinion, most developers who wrotes the codes themselves most likely wouldn't heavily embed their CSS and JS into the HTML file because of readability.
efortis · 5h ago
- Needless guards, e.g. `if (document) document.body…` in the browser.

- Backwards compatibility, "This way handles version X, which end-of-life was 10 years ago."

- Unit tests with too much overlap. "Should add positive nums, Adds neg nums, Adds zero, …"

ayyeye2 · 6h ago
While I'm sure this question is being asked in good faith, and this site is certainly the place for discussion regarding such matters, anyone replying might want to consider that you are assiting both sides in the development of this tech by pointing out it's identifying features. All clues to how LLMs generate and display output can then be better hidden from their next iteration.

Think twice; don't feed the beast.

No comments yet