I Deleted 168,000 Lines of Comments. My AI Agent Didn't Notice(openstation.blog) |
I Deleted 168,000 Lines of Comments. My AI Agent Didn't Notice(openstation.blog) |
- All the comments removed (the blog post)
- Half the comments removed
- 10% of the comments replaced with slightly incorrect comments
- 10% of the comments replaced with very incorrect comments
- 10% of the comments replaced with slightly incorrect comments
- 90% of the comments removed, 10% remain but are very incorrect
And variations like that
Test to see where the inflection point is for correctness, token usage and other things
Seems like this might be another example of The Bitter Lesson [1]:
"The bitter lesson is the observation in artificial intelligence that, in the long run, general approaches that scale with available computational power tend to outperform ones based on domain-specific understanding because they are better at taking advantage of the falling cost of computation over time."
AIs don't need comments that are designed to work around human cognitive limitations. They're quite happy to just crunch the code and extract the meaning.
And burn X more tokens on rediscovering relevant surrounding context, rather than having it potentially readily available - or at least pointers to it - in the comments.
I think there are still contexts where comments would be superior like when they feed into an OpenAPI spec where the AI or person can't see the code, and information that bubbles up through Intellisense (for humans anyway).
They tend to be wordy, long, and leak chatbot history or project management in unimportant ways that just distract.
I could point this out in my own code, but I don't need to since a vibe coded GitHub repo is linked in this very article.
> https://github.com/WordPress/openstation/blob/dd21eb131a2029...
// `const` now: the entry is no longer reassigned here, because
// `ensureGameRender()` moved inside the render callback below and
// its upgraded copy is consumed there.
> https://github.com/WordPress/openstation/blob/dd21eb131a2029... * Phase 5 (boot decomposition) will move the runtime facade
* assembly here as well — a single `attachPublicApi(services)`
* function that wires every `wp.os.*` method in one place.
* Until then, the runtime assembly continues to live in
* `src/desktop.ts`.
> https://github.com/WordPress/openstation/blob/dd21eb131a2029... * Phase 3 only ships drag-within-folder. Cross-folder drags
* (drop into a folder, drop out to root) and the Recycle Bin
* drop integration land in later phases.
> https://github.com/WordPress/openstation/blob/dd21eb131a2029... // v1: no-op. Phase 4 will populate this from the push payload.
// We claim the event so a hosting environment that signs us up
// for a push subscription before the v2 PR lands doesn't see
// silently-dropped pushes — the empty handler still satisfies
// `Notification` capability checks on browsers that gate them.
There is a certain taste to not drop comments like this, but there is a tendency to do this in AI. They drop references to phases of work and outdated architecture in ways that aren't helpful and then don't get cleaned up.Two important caveats, though, before we rush to universalize this:
1. It's based on the smartest model ever released to the public in the history of humanity, Opus 5.5. So if this is true for your codebase, it probably only became so ~post-Mythos.
2. It seems like the hard task isn't really hard enough -- the "trick" is something about PHP, and sounds common enough that it would be well baked into each model. Regardless, there are far, far easier to miss gotchas than "fails on reload", especially in a large codebase where a post-mortem are written about correct code that just runs slower all of a sudden or something, much less cases where you have to rely on users (or worse, metrics) to uncover such issues.
When I joined Google, they gave me the baffling instruction to try to write as few comments as possible. I've since learned that's a semi-popular approach, based on the logic that "the code should speak for itself". I'm just a baby engineer (4 more months to make it onto 30-under-30!), but I find that to be more about self-esteem for seniors and feeling like a craftsman than it is about real, measured tradeoffs.
Plus, comments can A) be documentation[1] and B) be beautiful[2] ;)
[1]: https://github.com/doering-ai/my-basis/blob/main/docs/regex....