---
title: "6 Code Quotes By Brian Kernighan"
description: "6 Code quotes by Brian Kernighan. Plus more from Brian Kernighan and more Code sayings from other authors."
image: "https://sms4smile.com/quotes/i/eee/brian-kernighan-27197_code_get-the-weirdnesses-into-the-data-where_136499.png"
---

> [Get the weirdnesses into the data where you can manipulate them easily, and the regularity into the code because regular code is…](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/)

[Image](https://sms4smile.com/quotes/i/eee/brian-kernighan-27197_code_get-the-weirdnesses-into-the-data-where_136499.png)

> [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/)

[Image](https://sms4smile.com/quotes/i/901/brian-kernighan-27197_boundaries_an-effective-way-to-test-code-is-to-exer_500847.png)

> [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/)

[Image](https://sms4smile.com/quotes/i/44a/brian-kernighan-27197_code_trivia-rarely-affect-efficiency-are-all_908086.png)

> [Don't document bad code - rewrite it.](https://sms4smile.com/quotes/brian-kernighan/don-t-document-bad-code-rewrite-it/)

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

[Image](https://sms4smile.com/quotes/i/702/brian-kernighan-27197_code_don-t-document-bad-code-rewrite-it-13922_1392281.png)

> [Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as…](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/)

[Image](https://sms4smile.com/quotes/i/0ad/brian-kernighan-27197_code_debugging-is-twice-as-hard-as-writing-th_1499521.jpg)

> [ Another effective \[debugging\] technique is to explain your code to someone else. This will often cause you to explain the bug to… ](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/)

[Image](https://sms4smile.com/quotes/i/fb9/brian-kernighan-27197_bears_another-effective-debugging-technique-is_1618728.jpg)

## Other authors on Code

- [ ![](https://sms4smile.com/quotes/wp-content/uploads/sms4s/authors/processed/b004/author-ayn-rand-15943.jpg) Ayn Rand 17 quotes ](https://sms4smile.com/quotes/about/code/ayn-rand/)
- [ ![](https://sms4smile.com/quotes/wp-content/uploads/sms4s/authors/processed/b011/author-hillary-clinton-42043.jpg) Hillary Clinton 13 quotes ](https://sms4smile.com/quotes/about/code/hillary-clinton/)
- [ ![](https://sms4smile.com/quotes/wp-content/uploads/sms4s/authors/processed/b010/author-frederick-lenz-36205.jpg) Frederick Lenz 10 quotes ](https://sms4smile.com/quotes/about/code/frederick-lenz/)
- [Robert C. Martin 9 quotes](https://sms4smile.com/quotes/about/code/robert-c-martin/)
- [ ![](https://sms4smile.com/quotes/wp-content/uploads/sms4s/authors/processed/b016/author-linus-torvalds-60596.jpg) Linus Torvalds 9 quotes ](https://sms4smile.com/quotes/about/code/linus-torvalds/)
- [ ![](https://sms4smile.com/quotes/wp-content/uploads/sms4s/authors/processed/b023/author-thomas-jefferson-90435.jpg) Thomas Jefferson 8 quotes ](https://sms4smile.com/quotes/about/code/thomas-jefferson/)
- [ ![](https://sms4smile.com/quotes/wp-content/uploads/sms4s/authors/processed/b022/author-steve-mcconnell-87333.jpg) Steve McConnell 8 quotes ](https://sms4smile.com/quotes/about/code/steve-mcconnell/)
- [ ![](https://sms4smile.com/quotes/wp-content/uploads/sms4s/authors/processed/b005/author-barack-obama-16275.jpg) Barack Obama 8 quotes ](https://sms4smile.com/quotes/about/code/barack-obama/)
- [ ![](https://sms4smile.com/quotes/wp-content/uploads/sms4s/authors/processed/b020/author-richard-stallman-78913.jpg) Richard Stallman 7 quotes ](https://sms4smile.com/quotes/about/code/richard-stallman/)
- [ ![](https://sms4smile.com/quotes/wp-content/uploads/sms4s/authors/processed/b020/author-richard-dawkins-78503.jpg) Richard Dawkins 7 quotes ](https://sms4smile.com/quotes/about/code/richard-dawkins/)
- [ ![](https://sms4smile.com/quotes/wp-content/uploads/sms4s/authors/processed/b003/author-alejandra-10680.jpg) Juan Enriquez 7 quotes ](https://sms4smile.com/quotes/about/code/juan-enriquez/)
- [ ![](https://sms4smile.com/quotes/wp-content/uploads/sms4s/authors/processed/b009/author-francis-crick-35454.jpg) Francis Crick 7 quotes ](https://sms4smile.com/quotes/about/code/francis-crick/)

## 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/)

> [Don't document bad code - rewrite it.](https://sms4smile.com/quotes/brian-kernighan/don-t-document-bad-code-rewrite-it/)

[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/)

```json
{
    "@context": "https://schema.org",
    "@graph": [
        {
            "@type": "ItemList",
            "@id": "https://sms4smile.com/quotes/about/code/brian-kernighan/#itemlist",
            "name": "6 Code Quotes By Brian Kernighan",
            "numberOfItems": 6,
            "itemListElement": [
                {
                    "@type": "ListItem",
                    "position": 1,
                    "item": {
                        "@type": "Quotation",
                        "text": "Get the weirdnesses into the data where you can manipulate them easily, and the regularity into the code because regular code is a lot easier to work with",
                        "creator": {
                            "@type": "Person",
                            "name": "Brian Kernighan"
                        },
                        "url": "https://sms4smile.com/quotes/brian-kernighan/get-the-weirdnesses-into-the-data-where-you-can-manipulate-them/",
                        "image": {
                            "@type": "ImageObject",
                            "@id": "https://sms4smile.com/quotes/i/eee/brian-kernighan-27197_code_get-the-weirdnesses-into-the-data-where_136499.png",
                            "contentUrl": "https://sms4smile.com/quotes/i/eee/brian-kernighan-27197_code_get-the-weirdnesses-into-the-data-where_136499.png",
                            "url": "https://sms4smile.com/quotes/i/eee/brian-kernighan-27197_code_get-the-weirdnesses-into-the-data-where_136499.png",
                            "width": 1080,
                            "height": 1080,
                            "caption": "“Get the weirdnesses into the data where you can manipulate them easily, and the regularity into the code…” — Brian Kernighan",
                            "creditText": "SMS4Smile Quotes",
                            "creator": {
                                "@id": "https://sms4smile.com/quotes/#organization"
                            }
                        }
                    }
                },
                {
                    "@type": "ListItem",
                    "position": 2,
                    "item": {
                        "@type": "Quotation",
                        "text": "An effective way to test code is to exercise it at its natural boundaries",
                        "creator": {
                            "@type": "Person",
                            "name": "Brian Kernighan"
                        },
                        "url": "https://sms4smile.com/quotes/brian-kernighan/an-effective-way-to-test-code-is-to-exercise-it-at-its-natural/",
                        "image": {
                            "@type": "ImageObject",
                            "@id": "https://sms4smile.com/quotes/i/901/brian-kernighan-27197_boundaries_an-effective-way-to-test-code-is-to-exer_500847.png",
                            "contentUrl": "https://sms4smile.com/quotes/i/901/brian-kernighan-27197_boundaries_an-effective-way-to-test-code-is-to-exer_500847.png",
                            "url": "https://sms4smile.com/quotes/i/901/brian-kernighan-27197_boundaries_an-effective-way-to-test-code-is-to-exer_500847.png",
                            "width": 1080,
                            "height": 1080,
                            "caption": "“An effective way to test code is to exercise it at its natural boundaries” — Brian Kernighan",
                            "creditText": "SMS4Smile Quotes",
                            "creator": {
                                "@id": "https://sms4smile.com/quotes/#organization"
                            }
                        }
                    }
                },
                {
                    "@type": "ListItem",
                    "position": 3,
                    "item": {
                        "@type": "Quotation",
                        "text": "Trivia rarely affect efficiency. Are all the machinations worth it, when their primary effect is to make the code less readable?",
                        "creator": {
                            "@type": "Person",
                            "name": "Brian Kernighan"
                        },
                        "url": "https://sms4smile.com/quotes/brian-kernighan/trivia-rarely-affect-efficiency-are-all-the-machinations-worth-it/",
                        "image": {
                            "@type": "ImageObject",
                            "@id": "https://sms4smile.com/quotes/i/44a/brian-kernighan-27197_code_trivia-rarely-affect-efficiency-are-all_908086.png",
                            "contentUrl": "https://sms4smile.com/quotes/i/44a/brian-kernighan-27197_code_trivia-rarely-affect-efficiency-are-all_908086.png",
                            "url": "https://sms4smile.com/quotes/i/44a/brian-kernighan-27197_code_trivia-rarely-affect-efficiency-are-all_908086.png",
                            "width": 1080,
                            "height": 1080,
                            "caption": "“Trivia rarely affect efficiency. Are all the machinations worth it, when their primary effect is to make the…” — Brian Kernighan",
                            "creditText": "SMS4Smile Quotes",
                            "creator": {
                                "@id": "https://sms4smile.com/quotes/#organization"
                            }
                        }
                    }
                },
                {
                    "@type": "ListItem",
                    "position": 4,
                    "item": {
                        "@type": "Quotation",
                        "text": "Don't document bad code - rewrite it.",
                        "creator": {
                            "@type": "Person",
                            "name": "Brian Kernighan"
                        },
                        "url": "https://sms4smile.com/quotes/brian-kernighan/don-t-document-bad-code-rewrite-it/",
                        "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": "ListItem",
                    "position": 5,
                    "item": {
                        "@type": "Quotation",
                        "text": "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.",
                        "creator": {
                            "@type": "Person",
                            "name": "Brian Kernighan"
                        },
                        "url": "https://sms4smile.com/quotes/brian-kernighan/debugging-is-twice-as-hard-as-writing-the-code-in-the-first-place/",
                        "image": {
                            "@type": "ImageObject",
                            "@id": "https://sms4smile.com/quotes/i/0ad/brian-kernighan-27197_code_debugging-is-twice-as-hard-as-writing-th_1499521.jpg",
                            "contentUrl": "https://sms4smile.com/quotes/i/0ad/brian-kernighan-27197_code_debugging-is-twice-as-hard-as-writing-th_1499521.jpg",
                            "url": "https://sms4smile.com/quotes/i/0ad/brian-kernighan-27197_code_debugging-is-twice-as-hard-as-writing-th_1499521.jpg",
                            "width": 1080,
                            "height": 1080,
                            "caption": "“Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as…” — Brian Kernighan",
                            "creditText": "SMS4Smile Quotes",
                            "creator": {
                                "@id": "https://sms4smile.com/quotes/#organization"
                            }
                        }
                    }
                },
                {
                    "@type": "ListItem",
                    "position": 6,
                    "item": {
                        "@type": "Quotation",
                        "text": "Another effective [debugging] technique is to explain your code to someone else. This will often cause you to explain the bug to yourself. Sometimes it takes no more than a few sentences, followed by an embarrassed \"Never mind, I see what's wrong. Sorry to bother you.\" This works remarkably well; you can even use non-programmers as listeners. One university computer center kept a teddy bear near the help desk. Students with mysterious bugs were required to explain them to the bear before they could speak to a human counselor.",
                        "creator": {
                            "@type": "Person",
                            "name": "Brian Kernighan"
                        },
                        "url": "https://sms4smile.com/quotes/brian-kernighan/another-effective-debugging-technique-is-to-explain-your-code-to/",
                        "image": {
                            "@type": "ImageObject",
                            "@id": "https://sms4smile.com/quotes/i/fb9/brian-kernighan-27197_bears_another-effective-debugging-technique-is_1618728.jpg",
                            "contentUrl": "https://sms4smile.com/quotes/i/fb9/brian-kernighan-27197_bears_another-effective-debugging-technique-is_1618728.jpg",
                            "url": "https://sms4smile.com/quotes/i/fb9/brian-kernighan-27197_bears_another-effective-debugging-technique-is_1618728.jpg",
                            "width": 1080,
                            "height": 1080,
                            "caption": "“Another effective [debugging] technique is to explain your code to someone else. This will often cause you…” — Brian Kernighan",
                            "creditText": "SMS4Smile Quotes",
                            "creator": {
                                "@id": "https://sms4smile.com/quotes/#organization"
                            }
                        }
                    }
                }
            ]
        },
        {
            "@type": "CollectionPage",
            "@id": "https://sms4smile.com/quotes/about/code/brian-kernighan/#webpage",
            "url": "https://sms4smile.com/quotes/about/code/brian-kernighan/",
            "name": "Code Quotes by Brian Kernighan",
            "isPartOf": {
                "@id": "https://sms4smile.com/quotes/#website"
            },
            "mainEntity": {
                "@id": "https://sms4smile.com/quotes/about/code/brian-kernighan/#itemlist"
            },
            "primaryImageOfPage": {
                "@id": "https://sms4smile.com/quotes/i/eee/brian-kernighan-27197_code_get-the-weirdnesses-into-the-data-where_136499.png"
            },
            "description": "6 Code quotes by Brian Kernighan. Plus more from Brian Kernighan and more Code sayings from other authors.",
            "breadcrumb": {
                "@id": "https://sms4smile.com/quotes/about/code/brian-kernighan/#breadcrumb"
            }
        },
        {
            "@type": "BreadcrumbList",
            "@id": "https://sms4smile.com/quotes/about/code/brian-kernighan/#breadcrumb",
            "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": "Topics",
                    "item": "https://sms4smile.com/quotes/categories/"
                },
                {
                    "@type": "ListItem",
                    "position": 4,
                    "name": "Code",
                    "item": "https://sms4smile.com/quotes/about/code/"
                },
                {
                    "@type": "ListItem",
                    "position": 5,
                    "name": "Brian Kernighan",
                    "item": "https://sms4smile.com/quotes/about/code/brian-kernighan/"
                }
            ]
        },
        {
            "@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
            }
        }
    ]
}
```
