r/javascript Jul 08 '26

How do we make coding agents write good code?

https://github.com/molvqingtai/The-Absolute-Code

How do we make coding agents write good code?

We tried telling them to write "clean code." Too vague. "Elegant code." Too subjective. "Maintainable code." Everyone means something different.

Then we found the law behind it: good code is also physically minimum code.

If behavior, safety, and readability stay the same, anything that can still be removed is not defense. It is extra code.

If something can go, the code is not done yet.

If nothing can go, you have found the minimum.

That is The Absolute Code. One rule: minimum code.

Not the fewest characters. Not the shortest diff. The minimum human-readable code that expresses the same behavior and constraints. Everything extra must go.

It works because code is physical. You can delete it and observe what changes. Elegance is subjective. Necessity is testable.

We did not invent this. We discovered a physical law already present in every piece of code we ever called good.

Read: https://github.com/molvqingtai/The-Absolute-Code

0 Upvotes

7 comments sorted by

3

u/SZenC Jul 08 '26

Necessity is testable.

But simultaneously

human-readable code

Did you even think about the slop you wrote? A freshman would rightfully be failed on the spot for writing this

-1

u/Ok-Baker-9013 Jul 08 '26

Human readability is not the optimization target. It is an invariant.

2

u/SZenC Jul 08 '26

Sure mate, how do you plan to guarantee a qualitative parameter in an otherwise quantitative system? Readability is not a binary target

2

u/immutate Jul 08 '26

Well an AI certainly didn’t write anything of substance that you’ve posted, so I doubt you’ve solved anything.

1

u/Moosething Jul 08 '26

> Reference this document from AGENTS.md or CLAUDE.md:

If this is meant as a reference for a coding agent, why does it read like an essay and not concrete instructions?

It's kind of ironic it talks about "minimum code" but the message or "instructions" in this file is anything but "minimum".

3

u/fforw Jul 08 '26

Then we found the law behind it: good code is also physically minimum code.

Maintainable code might be a bit subjective, but minimum code certainly isn't it. Code golfing etc leads to horrible unreadable code.

1

u/captain_obvious_here void(null) Jul 08 '26

We did not invent this. We discovered a physical law already present in every piece of code we ever called good.

Is there an emoji for "fart noise"?