Quotes from Code Complete

914 pages

Rating: (7K votes)


“Programmers working with high-level languages achieve better productivity and quality than those working with lower-level languages. Languages such as C++, Java, Smalltalk, and Visual Basic have been credited with improving productivity, reliability, simplicity, and comprehensibility by factors of 5 to 15 over low-level languages such as assembly and C (Brooks 1987, Jones 1998, Boehm 2000). You save time when you don't need to have an awards ceremony every time a C statement does what it's supposed to.”
― quote from Code Complete


“Heuristic is an algorithm in a clown suit. It’s less predictable, it’s more fun, and it comes without a 30-day, money-back guarantee.”
― quote from Code Complete


“the road to programming hell is paved with global variables,”
― quote from Code Complete


“once gotos are introduced, they spread through the code like termites through a rotting house.”
― quote from Code Complete


“Trying to improve software quality by increasing the amount of testing is like trying to lose weight by weighing yourself more often. What you eat before you step onto the scale determines how much you will weigh, and the software-development techniques you use determine how many errors testing will find.”
― quote from Code Complete



“You can do anything with stacks and iteration that you can do with recursion.”
― quote from Code Complete


“One of the paradoxes of defensive programming is that during development, you'd like an error to be noticeable—you'd rather have it be obnoxious than risk overlooking it. But during production, you'd rather have the error be as unobtrusive as possible, to have the program recover or fail gracefully.”
― quote from Code Complete


“developers insert an average of 1 to 3 defects per hour into their designs and 5 to 8 defects per hour into code”
― quote from Code Complete


“The goal is to minimize the amount of a program you have to think about at any one time. You might think of this as mental juggling—the more mental balls the program requires you to keep in the air at once, the more likely you'll drop one of the balls, leading to a design or coding error.”
― quote from Code Complete


“Spend your time on the 20 percent of the refactorings that provide 80 percent of the benefit.”
― quote from Code Complete



“A brute-force solution that works is better than an elegant solution that doesn't work. It can take a long time to get an elegant solution to work. In describing the history of searching algorithms, for example, Donald Knuth pointed out that even though the first description of a binary search algorithm was published in 1946, it took another 16 years for someone to publish an algorithm that correctly searched lists of all sizes (Knuth 1998). A binary search is more elegant, but a brute-force, sequential search is often sufficient. When in doubt, use brute force. — Butler Lampson”
― quote from Code Complete


“Reduce complexity. The single most important reason to create a routine is to reduce a program's complexity. Create a routine to hide information so that you won't need to think about it.”
― quote from Code Complete


“Inheritance adds complexity to a program, and, as such, it's a dangerous technique. As Java guru Joshua Bloch says, "Design and document for inheritance, or prohibit it." If a class isn't designed to be inherited from, make its members non-virtual in C++, final in Java, or non-overridable in Microsoft Visual Basic so that you can't inherit from it.”
― quote from Code Complete


“Managing complexity is the most important technical topic in software development. In my view, it's so important that Software's Primary Technical Imperative has to be managing complexity. Complexity is not a new feature of software development.”
― quote from Code Complete


“The most challenging part of programming is conceptualizing the problem, and many errors in programming are conceptual errors. Because”
― quote from Code Complete



“Steps in Building a Routine Many of a class's routines will be simple and straightforward to implement: accessor routines, pass-throughs to other objects' routines, and the like. Implementation of other routines will be more complicated, and creation of those routines benefits from a systematic approach. The major activities involved in creating a routine—designing the routine, checking the design, coding the routine, and checking the code—are typically performed in the order shown in Figure 9-2. Figure 9-2. These are the major activities that go into constructing a routine. They're usually performed in the order shown”
― quote from Code Complete


“Don't differentiate routine names solely by number. One developer wrote all his code in one big function. Then he took every 15 lines and created functions named Part1, Part2, and so on. After that, he created one high-level function that called each part.”
― quote from Code Complete


“By relieving the brain of all unnecessary work, a good notation sets it free to concentrate on more advanced problems, and in effect increases the mental power of the race. Before the introduction of the Arabic notation, multiplication was difficult, and the division even of integers called into play the highest mathematical faculties. Probably nothing in the modern world would have more astonished a Greek mathematician than to learn that … a huge proportion of the population of Western Europe could perform the operation of division for the largest numbers. This fact would have seemed to him a sheer impossibility…. Our modern power of easy reckoning with decimal fractions is the almost miraculous result of the gradual discovery of a perfect notation. —Alfred North Whitehead”
― quote from Code Complete


“In the case of natural languages, the linguists Sapir and Whorf hypothesize a relationship between the expressive power of a language and the ability to think certain thoughts. The Sapir-Whorf hypothesis says that your ability to think a thought depends on knowing words capable of expressing the thought. If you don't know the words, you can't express the thought and”
― quote from Code Complete


“The words available in a programming language for expressing your programming thoughts certainly determine how you express your thoughts and might even determine what thoughts you can express.”
― quote from Code Complete



“During production, your users need a chance to save their work before the program crashes and they are probably willing to tolerate a few anomalies in exchange for keeping the program going long enough for them to do that. Users don't appreciate anything that results in the loss of their work, regardless of how much it helps debugging and ultimately improves the quality of the program. If your program contains debugging code that could cause a loss of data, take it out of the production version.”
― quote from Code Complete


“Example 6-11. Java Example of Enforcing a Singleton with a Private Constructor public class MaxId {    // constructors and destructors    private MaxId() {       <-- 1       ...    }    ...    // public routines    public static MaxId GetInstance() {       <-- 2       return m_instance;    }    ...    // private members    private static final MaxId m_instance = new MaxId();       <-- 3    ... } (1)Here is the private constructor. (2)Here is the public routine that provides access to the single instance. (3)Here is the single instance.”
― quote from Code Complete


“Steps in Building a Routine Many of a class's routines will be simple and straightforward to implement: accessor routines, pass-throughs to other objects' routines, and the like. Implementation of other routines will be more complicated, and creation of those routines benefits from a systematic approach. The major activities involved in creating a routine—designing the routine, checking the design, coding the routine, and checking the code—are typically performed in the order shown in Figure 9-2. Figure 9-2. These are the major activities that go into constructing a routine. They're usually performed in the order”
― quote from Code Complete


“Here are the benefits you can expect from using this style of pseudocode: Pseudocode makes reviews easier. You can review detailed designs without examining source code. Pseudocode makes low-level design reviews easier and reduces the need to review the code itself. Pseudocode supports the idea of iterative refinement. You start with a high-level design, refine the design to pseudocode, and then refine the pseudocode to source code. This successive refinement in small steps allows you to check your design as you drive it to lower levels of detail. The result is that you catch high-level errors at the highest level, mid-level errors at the middle level, and low-level errors at the lowest level—before any of them becomes a problem or contaminates work at more detailed levels. Pseudocode makes changes easier. A few lines of pseudocode are easier to change than a page of code. Would you rather change a line on a blueprint or rip out a wall and nail in the two-by-fours somewhere else? The effects aren't as physically dramatic in software, but the principle of changing the product when it's most malleable is the same. One of the keys to the success of a project is to catch errors at the "least-value stage," the stage at which the least effort has been invested. Much less has been invested at the pseudocode stage than after full coding, testing, and debugging, so it makes economic sense to catch the errors early.”
― quote from Code Complete


“Because it's a poor tradeoff to add complexity for dubious performance gains, a good approach to deep vs. shallow copies is to prefer deep copies until proven otherwise.”
― quote from Code Complete



“One symptom that you have bogged down in complexity overload is when you find yourself doggedly applying a method that is clearly irrelevant, at least to any outside observer. It is like the mechanically inept person whose car breaks down—so he puts water in the battery and empties the ashtrays. — P. J. Plauger”
― quote from Code Complete


“At the software-architecture level, the complexity of a problem is reduced by dividing the system into subsystems. Humans have an easier time comprehending several simple pieces of information than one complicated piece.”
― quote from Code Complete


“The more independent the subsystems are, the more you make it safe to focus on one bit of complexity at a time. Carefully defined objects separate concerns so that you can focus on one thing at a time. Packages provide the same benefit at a higher level of aggregation.”
― quote from Code Complete


“Another good reason to create a class is to model an abstract object—an object that isn't a concrete, real-world object but that provides an abstraction of other concrete objects. A good example is the classic Shape object. Circle and Square really exist, but Shape is an abstraction of other specific shapes.”
― quote from Code Complete


“modern software is inherently complex, and no matter how hard you try, you'll eventually bump into some level of complexity that's inherent in the real-world problem itself. This suggests a two-prong approach to managing complexity: Minimize the amount of essential complexity that anyone's brain has to deal with at any one time. Keep accidental complexity from needlessly proliferating. Once you understand that all other technical goals in software are secondary to managing complexity, many design considerations become straightforward.”
― quote from Code Complete



Popular quotes

“I don’t remember waking up that Sunday morning —- perhaps I never slept. Iwas just sitting up in bed watching Sarah sleep. She’d slept naked in my bed but she hadn’t let me have sex with her. I didn’t care. I loved watching her sleep. The light was falling through my window, all over the blue sheets of my old bed, and onto her face. I lifted up the sheets and watched her breasts move with her breath. They seemed to be sleeping themselves.
I hoped that she wouldn’t wake up. I laid the sheet back over her, right up to her chin.
I looked up and out of my room.
I thought, This must be what praying is like.”
― Ethan Hawke, quote from The Hottest State


“Most families have increased the speed of their lives and the number of their activities gradually--even unconsciously--over time. They realize that there are costs to a consistently fast-paced, hectic schedule, but they've adjusted. And looking around, there always seems to be another family that does everything you do, and more, managing to squeeze in skiing, or Space Camp, or French horn lessons on top of everything else. How do they do it?
They do it by never asking 'Why?' Why do our kids need to be busy all of the time? Why does our son, age twelve, need to explore the possibility of space travel? Why do we feel we must offer everything? Why must it all happen now? Why does tomorrow always seem a bit late? Why would we rather squeeze more things into our schedules than to see what happens over time? What happens when we stop, when we have free time?”
― quote from Simplicity Parenting: Using the Extraordinary Power of Less to Raise Calmer, Happier, and More Secure Kids


“These simple words reveal Rahab’s amazing destiny: Salmon the father of Boaz, whose mother was Rahab (Matthew 1:5). In other words, Salmone and Rahab were married and had a son. The Bible gives us a glimpse into Salmone’s background through several genealogies (1 Chronicles 2:11; Ruth 4:20–21). Clearly, he comes from a highly distinguished family in the house of Judah; his father Nahshon is the leader of the people of Judah, and his father’s sister is wife to Aaron (Numbers 2:3–4). Of Salmone’s own specific accomplishments and activities nothing is known. But the verse in Matthew is still shocking. How could a man who is practically a Jewish aristocrat, significant enough to get his name recorded in the Scriptures, marry a Canaanite woman who has earned her living entertaining gentlemen? Much of this novel deals with that question. Needless to say, this aspect of the story is purely fictional. We only know that Salmone married Rahab and had a son by her, and that Jesus Himself counts this Canaanite harlot as one of His ancestors. On how such a marriage came about or what obstacles it faced, the Bible is silent.”
― Tessa Afshar, quote from Pearl in the Sand


“What—does she think she’s too good to offer me sex in exchange for money?” I whimpered to myself. “The nerve of her!”
― Dave Hill, quote from Tasteful Nudes and Other Misguided Attempts at Personal Growth and Validation


“He hugged her tight, mixing their tears to be bottled and fermented, so they could be drunk on each other when this was all over.”
― Pete Wentz, quote from The Boy With The Thorn In His Side


Interesting books

The Girl She Used to Be
(4.4K)
The Girl She Used to...
by David Cristofano
A Room of One's Own / Three Guineas
(2.5K)
A Room of One's Own...
by Virginia Woolf
Falling Is Like This
(184)
Falling Is Like This
by Kate Rockland
The Pastures of Heaven
(5.3K)
The Pastures of Heav...
by John Steinbeck
The Heir
(5.8K)
The Heir
by Grace Burrowes
Cruddy
(5.4K)
Cruddy
by Lynda Barry

About BookQuoters

BookQuoters is a community of passionate readers who enjoy sharing the most meaningful, memorable and interesting quotes from great books. As the world communicates more and more via texts, memes and sound bytes, short but profound quotes from books have become more relevant and important. For some of us a quote becomes a mantra, a goal or a philosophy by which we live. For all of us, quotes are a great way to remember a book and to carry with us the author’s best ideas.

We thoughtfully gather quotes from our favorite books, both classic and current, and choose the ones that are most thought-provoking. Each quote represents a book that is interesting, well written and has potential to enhance the reader’s life. We also accept submissions from our visitors and will select the quotes we feel are most appealing to the BookQuoters community.

Founded in 2023, BookQuoters has quickly become a large and vibrant community of people who share an affinity for books. Books are seen by some as a throwback to a previous world; conversely, gleaning the main ideas of a book via a quote or a quick summary is typical of the Information Age but is a habit disdained by some diehard readers. We feel that we have the best of both worlds at BookQuoters; we read books cover-to-cover but offer you some of the highlights. We hope you’ll join us.