Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

The Kernighan law says debugging code is twice as hard as creating it.

Therefore, if you push yourself to the limit of your abilities to create the most clever code you can, you won't be able to debug it.



> The Kernighan law says debugging code is twice as hard as creating it.

> Therefore, if you push yourself to the limit of your abilities to create the most clever code you can, you won't be able to debug it.

If only advocates of LLM-based code generation understood this lemma.


Is LLM output the kind of clever we're talking about here? I always thought the quote was about abstraction astronautics, not large amounts of dumb just-do-it code.


It applies to LLM code, but if you take the law at face value, it's a very damaging one. Cleverness should be used to make your code easier to verify, not harder.

He said it with a very specific idea in mind, and like most of software engineering "laws", if you know enough to know when to apply it, you don't need the law.


No, it just means you'll be spending extra time debugging it. The most clever code is often cleverness which isn't from you, but derived from the field over time.




Consider applying for YC's Winter 2026 batch! Applications are open till Nov 10

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: