Hacker News Viewer

Kernighan on Programming

by chrisjj on 2/2/2026, 3:57:32 PM

&quot;Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it&quot;<p>This has been a timely PSA.

Comments

by: awkward

Kernighan&#x27;s Lever - <a href="https:&#x2F;&#x2F;linusakesson.net&#x2F;programming&#x2F;kernighans-lever&#x2F;index.php" rel="nofollow">https:&#x2F;&#x2F;linusakesson.net&#x2F;programming&#x2F;kernighans-lever&#x2F;index....</a><p>This article is perennially posted here and is probably the best breakdown of this quote.

2/2/2026, 4:28:16 PM


by: jama211

Reading this article seems outdated and therefore quaint in some areas now, the “we’ve all felt that moment of staring at a small bit of simple code that can’t possibly be failing and yet it does” - I so rarely experience this anymore as I’d have an LLM take a look and they tend to find these sort of “stupid” bugs very quickly. But my earlier days were full of these issues so it’s almost nostalgic for me now. Bugs nowadays are far more insidious when they crop up.

2/2/2026, 5:41:32 PM


by: flipped

In the age of LLMs, debugging is going to be the large part of time spent.

2/2/2026, 4:57:25 PM


by: agentultra

So is reviewing and verifying code. Maybe not twice as &quot;hard&quot; if you&#x27;re skilled in such things. But most programmers I&#x27;ve worked with can&#x27;t be bothered to write tests let alone verify correctness by other means (good tests, property tests, types, model checking, etc).<p>It&#x27;s one thing to point out small trivialities like initialization and life time issues in a small piece of code. But it&#x27;s quite another to prove they don&#x27;t exist in a large code base.<p>Kernigan is a good source of quotes and thinking on programming.

2/2/2026, 4:46:17 PM


by: copilot_king

[dead]

2/2/2026, 4:46:57 PM


by: akiselev

The real question is whether “debugging” the LLM is going to be as effective as debugging the code.<p>IME it pays dividends but it can be really painful. I’ve run into a situation multiple times where I’m using Claude Code to write something, then a week later while working it’ll come up with something like “Oh wait! Half the binaries are in .Net and not Delphi, I can just decompile them with ilspy”, effectively showing the way to a better rewrite that works better with fewer bugs that gets done in a few hours because I’ve got more experience from the v1. Either way it’s tens of thousands of lines of code that I could never have completed myself in that amount of time (which, given problems of motivation, means “at all”).

2/2/2026, 5:08:16 PM