---
title: "Meaning & Key Takeaway of: Don't document bad code - rewrite it."
description: "\"Don't document bad code - rewrite it.\" — Brian Kernighan"
image: "https://sms4smile.com/quotes/i/702/brian-kernighan-27197_code_don-t-document-bad-code-rewrite-it-13922_1392281.png"
---

#  Don't document bad code - rewrite it.

![“Don't document bad code - rewrite it.” quote by Brian Kernighan](https://sms4smile.com/quotes/i/702/brian-kernighan-27197_code_don-t-document-bad-code-rewrite-it-13922_1392281.png)   [Download](https://sms4smile.com/quotes/i/702/brian-kernighan-27197_code_don-t-document-bad-code-rewrite-it-13922_1392281.png) [Open image](https://sms4smile.com/quotes/i/702/brian-kernighan-27197_code_don-t-document-bad-code-rewrite-it-13922_1392281.png)

> “Don't document bad code - rewrite it.”

[Brian Kernighan](https://sms4smile.com/quotes/author/brian-kernighan/)

## About This Quote

This interpretation was drafted with AI assistance. It is one reading of the quote, not the author's own explanation.

Bad code should be replaced, not just documented, because documentation masks problems.

**In simple terms:** Fix code, don’t just note flaws.

Key Takeaway

Rewrite to improve quality.

Themes

software quality maintenance best practices

Mood

practical critical

Type

advice technical

When to use this quote

- software development
- code reviews
- team collaboration

Key Concepts

technical debt code hygiene

Questions to Reflect On

- How does rewriting affect project timelines?
- When is documentation sufficient?

A Different Perspective

Documentation alone cannot eliminate underlying issues.

★ ★ ★ ★ ★   No ratings yet

[Code](https://sms4smile.com/quotes/about/code/) [Code quality](https://sms4smile.com/quotes/about/code-quality/) [Inspirational](https://sms4smile.com/quotes/about/inspirational/) [Love](https://sms4smile.com/quotes/about/love/) [Programming](https://sms4smile.com/quotes/about/programming/) [Quality](https://sms4smile.com/quotes/about/quality/) [Software engineering](https://sms4smile.com/quotes/about/software-engineering/) [Technology](https://sms4smile.com/quotes/about/technology/)

## Related quotes

> [“Don’t comment bad code—rewrite it.”](https://sms4smile.com/quotes/brian-w-kernighan/don-t-comment-bad-code-rewrite-it/)

Brian W. Kernighan

> [Time pressure gradually corrupts an engineer's standard of quality and perfection. It has a detrimental effect on people as well as products](https://sms4smile.com/quotes/niklaus-wirth/time-pressure-gradually-corrupts-an-engineer-s-standard-of-quality/)

[Niklaus Wirth](https://sms4smile.com/quotes/author/niklaus-wirth/)

> [Good visual layout shows the logical structure of a program.](https://sms4smile.com/quotes/steve-mcconnell/good-visual-layout-shows-the-logical-structure-of-a-program/)

[Steve McConnell](https://sms4smile.com/quotes/author/steve-mcconnell/)

> [An API that isn't comprehensible isn't usable.](https://sms4smile.com/quotes/james-gosling/an-api-that-isn-t-comprehensible-isn-t-usable/)

[James Gosling](https://sms4smile.com/quotes/author/james-gosling/)

> [Programs should be written and polished until they acquire publication quality.](https://sms4smile.com/quotes/niklaus-wirth/programs-should-be-written-and-polished-until-they-acquire/)

[Niklaus Wirth](https://sms4smile.com/quotes/author/niklaus-wirth/)

> [“When I asked Sam Shillace, who ran Gmail and Google Apps for four years, about the costliest mistake he's seen engineers make, his response…](https://sms4smile.com/quotes/edmond-lau/when-i-asked-sam-shillace-who-ran-gmail-and-google-apps-for-four/)

[Edmond Lau](https://sms4smile.com/quotes/author/edmond-lau/)

> [“What makes us erratic, what makes us slow down, is the accidental difficulty. We call this difficulty “bad code”.”](https://sms4smile.com/quotes/anonymous/what-makes-us-erratic-what-makes-us-slow-down-is-the-accidental/)

[Anonymous](https://sms4smile.com/quotes/author/anonymous/)

> [“Code without tests is bad code. It doesn't matter how well written it is; it doesn't matter how pretty or object-oriented or well-encapsulated it…](https://sms4smile.com/quotes/michael-feathers/code-without-tests-is-bad-code-it-doesn-t-matter-how-well-written-it/)

Michael Feathers

> [The simple fact is that code quality tends to improve as you move between platforms... non-obvious bugs on Windows become VERY obvious in the…](https://sms4smile.com/quotes/ryan-c-gordon/the-simple-fact-is-that-code-quality-tends-to-improve-as-you-move/)

[Ryan C. Gordon](https://sms4smile.com/quotes/author/ryan-c-gordon/)

> [Are you quite sure that all those bells and whistles, all those wonderful facilities of your so called powerful programming languages, belong to the…](https://sms4smile.com/quotes/edsger-dijkstra/are-you-quite-sure-that-all-those-bells-and-whistles-all-those/)

[Edsger Dijkstra](https://sms4smile.com/quotes/author/edsger-dijkstra/)

> [Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you…](https://sms4smile.com/quotes/brian-kernighan/debugging-is-twice-as-hard-as-writing-the-code-in-the-first-place/)

[Brian Kernighan](https://sms4smile.com/quotes/author/brian-kernighan/)

> [Releasing Linux versions has always been a matter of higher code quality, good software architecture, and technical interest for the platform.](https://sms4smile.com/quotes/timothee-besset/releasing-linux-versions-has-always-been-a-matter-of-higher-code/)

Timothee Besset

> [Testing by itself does not improve software quality. Test results are an indicator of quality, but in and of themselves, they don't improve it.…](https://sms4smile.com/quotes/steve-mcconnell/testing-by-itself-does-not-improve-software-quality-test-results-are/)

[Steve McConnell](https://sms4smile.com/quotes/author/steve-mcconnell/)

> [As we said in the preface to the first edition, C "wears well as one's experience with it grows." With a decade more experience,…](https://sms4smile.com/quotes/brian-kernighan/as-we-said-in-the-preface-to-the-first-edition-c-wears-well-as-one-s/)

[Brian Kernighan](https://sms4smile.com/quotes/author/brian-kernighan/)

> [“Small tests lead to code quality. Medium and large tests lead to product quality.”](https://sms4smile.com/quotes/james-a-whittaker/small-tests-lead-to-code-quality-medium-and-large-tests-lead-to/)

[James A. Whittaker](https://sms4smile.com/quotes/author/james-a-whittaker/)

## More by Brian Kernighan

> [Get the weirdnesses into the data where you can manipulate them easily, and the regularity into the code because regular code is a lot…](https://sms4smile.com/quotes/brian-kernighan/get-the-weirdnesses-into-the-data-where-you-can-manipulate-them/)

[Brian Kernighan](https://sms4smile.com/quotes/author/brian-kernighan/)

> [Trying to outsmart a compiler defeats much of the purpose of using one.](https://sms4smile.com/quotes/brian-kernighan/trying-to-outsmart-a-compiler-defeats-much-of-the-purpose-of-using-one/)

[Brian Kernighan](https://sms4smile.com/quotes/author/brian-kernighan/)

> [An effective way to test code is to exercise it at its natural boundaries](https://sms4smile.com/quotes/brian-kernighan/an-effective-way-to-test-code-is-to-exercise-it-at-its-natural/)

[Brian Kernighan](https://sms4smile.com/quotes/author/brian-kernighan/)

> [As we said in the preface to the first edition, C "wears well as one's experience with it grows." With a decade more experience,…](https://sms4smile.com/quotes/brian-kernighan/as-we-said-in-the-preface-to-the-first-edition-c-wears-well-as-one-s/)

[Brian Kernighan](https://sms4smile.com/quotes/author/brian-kernighan/)

> [Trivia rarely affect efficiency. Are all the machinations worth it, when their primary effect is to make the code less readable?](https://sms4smile.com/quotes/brian-kernighan/trivia-rarely-affect-efficiency-are-all-the-machinations-worth-it/)

[Brian Kernighan](https://sms4smile.com/quotes/author/brian-kernighan/)

> [If you had done something twice, you are likely to do it again.](https://sms4smile.com/quotes/brian-kernighan/if-you-had-done-something-twice-you-are-likely-to-do-it-again/)

[Brian Kernighan](https://sms4smile.com/quotes/author/brian-kernighan/)

> [C is a razor-sharp tool, with which one can create an elegant and efficient program or a bloody mess.](https://sms4smile.com/quotes/brian-kernighan/c-is-a-razor-sharp-tool-with-which-one-can-create-an-elegant-and/)

[Brian Kernighan](https://sms4smile.com/quotes/author/brian-kernighan/)

> [Believe the terrain, not the map](https://sms4smile.com/quotes/brian-kernighan/believe-the-terrain-not-the-map/)

[Brian Kernighan](https://sms4smile.com/quotes/author/brian-kernighan/)

> [Mechanical rules are never a substitute for clarity of thought.](https://sms4smile.com/quotes/brian-kernighan/mechanical-rules-are-never-a-substitute-for-clarity-of-thought/)

[Brian Kernighan](https://sms4smile.com/quotes/author/brian-kernighan/)

> [Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you…](https://sms4smile.com/quotes/brian-kernighan/debugging-is-twice-as-hard-as-writing-the-code-in-the-first-place/)

[Brian Kernighan](https://sms4smile.com/quotes/author/brian-kernighan/)

> [“Everyone knows that debugging is twice as hard as writing a program in the first place. So if you're as clever as you can…](https://sms4smile.com/quotes/brian-kernighan/everyone-knows-that-debugging-is-twice-as-hard-as-writing-a-program/)

[Brian Kernighan](https://sms4smile.com/quotes/author/brian-kernighan/)

> [ Another effective \[debugging\] technique is to explain your code to someone else. This will often cause you to explain the bug to yourself. Sometimes… ](https://sms4smile.com/quotes/brian-kernighan/another-effective-debugging-technique-is-to-explain-your-code-to/)

[Brian Kernighan](https://sms4smile.com/quotes/author/brian-kernighan/)

> [... it is a fundamental principle of testing that you must know in advance the answer each test case is supposed to produce. If…](https://sms4smile.com/quotes/brian-kernighan/it-is-a-fundamental-principle-of-testing-that-you-must-know-in/)

[Brian Kernighan](https://sms4smile.com/quotes/author/brian-kernighan/)

> [Do what you think is interesting, do something that you think is fun and worthwhile, because otherwise you won't do it well anyway.](https://sms4smile.com/quotes/brian-kernighan/do-what-you-think-is-interesting-do-something-that-you-think-is-fun/)

[Brian Kernighan](https://sms4smile.com/quotes/author/brian-kernighan/)

> [Controlling complexity is the essence of computer programming.](https://sms4smile.com/quotes/brian-kernighan/controlling-complexity-is-the-essence-of-computer-programming/)

[Brian Kernighan](https://sms4smile.com/quotes/author/brian-kernighan/)

[Explore all 21 Brian Kernighan quotes ](https://sms4smile.com/quotes/author/brian-kernighan/)

## More Code quotes

> [At the deepest level, all living things that have ever been looked at have the same DNA code. And many of the same genes.](https://sms4smile.com/quotes/richard-dawkins/at-the-deepest-level-all-living-things-that-have-ever-been-looked-at/)

[Richard Dawkins](https://sms4smile.com/quotes/author/richard-dawkins/)

> [It is no secret that I have read 'The Da Vinci Code' several times. I genuinely believe that 'The Da Vinci Code' and 'Angels…](https://sms4smile.com/quotes/ashwin-sanghi/it-is-no-secret-that-i-have-read-the-da-vinci-code-several-times-i/)

[Ashwin Sanghi](https://sms4smile.com/quotes/author/ashwin-sanghi/)

> [Programmers are always surrounded by complexity; we cannot avoid it… If our basic tool, the language in which we design and code our programs,…](https://sms4smile.com/quotes/tony-hoare/programmers-are-always-surrounded-by-complexity-we-cannot-avoid-it-if/)

[Tony Hoare](https://sms4smile.com/quotes/author/tony-hoare/)

> [One of my most productive days was throwing away 1,000 lines of code.](https://sms4smile.com/quotes/ken-thompson/one-of-my-most-productive-days-was-throwing-away-1-000-lines-of-code/)

[Ken Thompson](https://sms4smile.com/quotes/author/ken-thompson/)

> [Writing code means always having to say you're sorry.](https://sms4smile.com/quotes/paul-ford/writing-code-means-always-having-to-say-you-re-sorry/)

[Paul Ford](https://sms4smile.com/quotes/author/paul-ford/)

> [It would be a piece of ingenuousness to accuse the man of today of his lack of moral code. The accusation would leave him…](https://sms4smile.com/quotes/jose-ortega-y-gasset/it-would-be-a-piece-of-ingenuousness-to-accuse-the-man-of-today-of/)

[Jose Ortega y Gasset](https://sms4smile.com/quotes/author/jose-ortega-y-gasset/)

> [I loved 'Chicago Code;' I watched that a lot. It was great because it really captured the city - I'm from Chicago, too.](https://sms4smile.com/quotes/jessy-schram/i-loved-chicago-code-i-watched-that-a-lot-it-was-great-because-it/)

[Jessy Schram](https://sms4smile.com/quotes/author/jessy-schram/)

> [I kind of pride myself on coming onto things that are well-oiled machines and finding a way to bring what I bring and fit…](https://sms4smile.com/quotes/rob-lowe/i-kind-of-pride-myself-on-coming-onto-things-that-are-well-oiled/)

[Rob Lowe](https://sms4smile.com/quotes/author/rob-lowe/)

> [When we're done simplifying the tax code, getting the lobbyist carve outs our of the tax code, lowering our rates and letting people have…](https://sms4smile.com/quotes/paul-ryan/when-we-re-done-simplifying-the-tax-code-getting-the-lobbyist-carve/)

[Paul Ryan](https://sms4smile.com/quotes/author/paul-ryan/)

> [The tax code is 10 times the size of the Bible with none of the good news.](https://sms4smile.com/quotes/paul-ryan/the-tax-code-is-10-times-the-size-of-the-bible-with-none-of-the-good/)

[Paul Ryan](https://sms4smile.com/quotes/author/paul-ryan/)

> [The Cheney team had, for example, technological supremacy over the National Security Council staff. That is to say, they could read their e-mails. I…](https://sms4smile.com/quotes/lawrence-wilkerson/the-cheney-team-had-for-example-technological-supremacy-over-the/)

[Lawrence Wilkerson](https://sms4smile.com/quotes/author/lawrence-wilkerson/)

> [ \[T\]he tax code has been piling up, year after year, a symbol of everything gone wrong in America, of arrogant rulers and lost freedom,… ](https://sms4smile.com/quotes/dick-armey/t-he-tax-code-has-been-piling-up-year-after-year-a-symbol-of/)

[Dick Armey](https://sms4smile.com/quotes/author/dick-armey/)

> [In open source, you really have to be near the watershed to have an impact on the source code. Customers want to be near…](https://sms4smile.com/quotes/peter-fenton/in-open-source-you-really-have-to-be-near-the-watershed-to-have-an/)

[Peter Fenton](https://sms4smile.com/quotes/author/peter-fenton/)

> [We can use our art to become political, to become something you want to talk about. We make clothes, but we have the chance…](https://sms4smile.com/quotes/olivier-rousteing/we-can-use-our-art-to-become-political-to-become-something-you-want/)

[Olivier Rousteing](https://sms4smile.com/quotes/author/olivier-rousteing/)

> [Your zip code or your income level should not dictate your access to healthy drinking water.](https://sms4smile.com/quotes/alex-padilla/your-zip-code-or-your-income-level-should-not-dictate-your-access-to/)

[Alex Padilla](https://sms4smile.com/quotes/author/alex-padilla/)

[Browse all 1,662 Code quotes ](https://sms4smile.com/quotes/about/code/)

```json
{
    "@context": "https://schema.org",
    "@graph": [
        {
            "@type": "Quotation",
            "text": "Don't document bad code - rewrite it.",
            "creator": {
                "@type": "Person",
                "name": "Brian Kernighan"
            },
            "isPartOf": {
                "@id": "https://sms4smile.com/quotes/#website"
            },
            "url": "https://sms4smile.com/quotes/brian-kernighan/don-t-document-bad-code-rewrite-it/",
            "about": {
                "@type": "Thing",
                "name": "Code"
            },
            "@id": "https://sms4smile.com/quotes/brian-kernighan/don-t-document-bad-code-rewrite-it/#quotation",
            "image": {
                "@type": "ImageObject",
                "@id": "https://sms4smile.com/quotes/i/702/brian-kernighan-27197_code_don-t-document-bad-code-rewrite-it-13922_1392281.png",
                "contentUrl": "https://sms4smile.com/quotes/i/702/brian-kernighan-27197_code_don-t-document-bad-code-rewrite-it-13922_1392281.png",
                "url": "https://sms4smile.com/quotes/i/702/brian-kernighan-27197_code_don-t-document-bad-code-rewrite-it-13922_1392281.png",
                "width": 1080,
                "height": 1080,
                "caption": "“Don't document bad code - rewrite it.” — Brian Kernighan",
                "creditText": "SMS4Smile Quotes",
                "creator": {
                    "@id": "https://sms4smile.com/quotes/#organization"
                }
            }
        },
        {
            "@type": "BreadcrumbList",
            "itemListElement": [
                {
                    "@type": "ListItem",
                    "position": 1,
                    "name": "Home",
                    "item": "https://sms4smile.com/"
                },
                {
                    "@type": "ListItem",
                    "position": 2,
                    "name": "Quotes",
                    "item": "https://sms4smile.com/quotes/"
                },
                {
                    "@type": "ListItem",
                    "position": 3,
                    "name": "Brian Kernighan",
                    "item": "https://sms4smile.com/quotes/author/brian-kernighan/"
                },
                {
                    "@type": "ListItem",
                    "position": 4,
                    "name": "Don't document bad code - rewrite...",
                    "item": "https://sms4smile.com/quotes/brian-kernighan/don-t-document-bad-code-rewrite-it/"
                }
            ],
            "@id": "https://sms4smile.com/quotes/brian-kernighan/don-t-document-bad-code-rewrite-it/#breadcrumb"
        },
        {
            "@type": "WebSite",
            "@id": "https://sms4smile.com/quotes/#website",
            "name": "SMS4Smile Quotes",
            "url": "https://sms4smile.com/quotes/",
            "publisher": {
                "@id": "https://sms4smile.com/quotes/#organization"
            }
        },
        {
            "@type": "Organization",
            "@id": "https://sms4smile.com/quotes/#organization",
            "name": "SMS4Smile Quotes",
            "url": "https://sms4smile.com/quotes/",
            "logo": {
                "@type": "ImageObject",
                "url": "https://sms4smile.com/quotes/wp-content/themes/sq/assets/icons/icon-512.png",
                "width": 512,
                "height": 512
            }
        }
    ]
}
```
