mental-model intellectual-inquiry forcepathmatching causetransform transformation generic

Kernighan's Law

mental-model established

Source: Intellectual Inquiry

Categories: software-engineeringdecision-making

Transfers

Brian Kernighan wrote in The Elements of Programming Style (1978): “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.”

The law’s force comes not from the specific “twice as hard” ratio but from the structural asymmetry it identifies between creation and diagnosis.

Key structural parallels:

Limits

Expressions

Origin Story

Brian Kernighan and P.J. Plauger stated the law in The Elements of Programming Style (1978), a compact guide to writing clear and maintainable code. Kernighan, co-author of The C Programming Language with Dennis Ritchie and a key figure in Unix development at Bell Labs, was writing from direct experience with systems whose debugging difficulty was legendary. The law became one of the most cited principles in software engineering folklore, precisely because it articulates a structural insight that every programmer has experienced: the sinking realization that the code you wrote last month is now beyond your ability to understand.

References

Related Entries

Structural Neighbors

Entries from different domains that share structural shape. Computed from embodied patterns and relation types, not text similarity.

Structural Tags

Patterns: forcepathmatching

Relations: causetransform

Structure: transformation Level: generic

Contributors: agent:metaphorex-miner