Facebook Pixel
Searching...
English
EnglishEnglish
EspañolSpanish
简体中文Chinese
FrançaisFrench
DeutschGerman
日本語Japanese
PortuguêsPortuguese
ItalianoItalian
한국어Korean
РусскийRussian
NederlandsDutch
العربيةArabic
PolskiPolish
हिन्दीHindi
Tiếng ViệtVietnamese
SvenskaSwedish
ΕλληνικάGreek
TürkçeTurkish
ไทยThai
ČeštinaCzech
RomânăRomanian
MagyarHungarian
УкраїнськаUkrainian
Bahasa IndonesiaIndonesian
DanskDanish
SuomiFinnish
БългарскиBulgarian
עבריתHebrew
NorskNorwegian
HrvatskiCroatian
CatalàCatalan
SlovenčinaSlovak
LietuviųLithuanian
SlovenščinaSlovenian
СрпскиSerbian
EestiEstonian
LatviešuLatvian
فارسیPersian
മലയാളംMalayalam
தமிழ்Tamil
اردوUrdu
Code Complete

Code Complete

A Practical Handbook of Software Construction
by Steve McConnell 1993 914 pages
4.30
9k+ ratings
Listen
Listen to Summary

Key Takeaways

1. Construction is Central: The Only Guaranteed Software Activity

Software construction is the central activity in software development; construction is the only activity that's guaranteed to happen on every project.

Construction Defined. Software construction encompasses detailed design, coding, debugging, unit testing, integration testing, and integration. It's the hands-on part of creating something, where abstract plans become tangible realities. While other phases like requirements and architecture can be shortchanged or skipped, construction is unavoidable if a program is to exist.

Construction's Importance. Construction typically consumes 30 to 80 percent of project time, making it a significant factor in project success. It's also the activity where most errors are introduced, highlighting the need for effective construction practices. Focusing on construction allows individual programmers to improve their productivity and the overall quality of the software.

Source Code as Truth. The source code produced during construction often becomes the only accurate description of the software. Requirements and design documents can become outdated, but the code remains the definitive, up-to-date representation of the system. Therefore, high-quality construction is essential for creating informative and maintainable software.

2. Metaphors Illuminate: Use Them to Understand and Communicate

Metaphors help you understand the software-development process by relating it to other activities you already know about.

Modeling with Metaphors. Metaphors are powerful tools for understanding complex concepts by relating them to familiar experiences. In software development, metaphors can provide insights into programming problems and processes, helping developers think more clearly and imagine better ways of doing things.

Heuristics, Not Algorithms. Software metaphors are not algorithms that provide direct solutions. Instead, they serve as heuristics, guiding the search for answers and suggesting new perspectives. They help you look for solutions, not dictate what to find.

Examples of Metaphors. Common software metaphors include:

  • Writing code as penmanship
  • Growing a system as farming
  • Building software as construction

The construction metaphor, in particular, emphasizes the importance of careful planning and preparation, highlighting the differences between small and large projects.

3. Preparation Prevents Problems: Prerequisites are Key

The overarching goal of preparing for construction is risk reduction.

Upstream Activities. Before diving into construction, it's crucial to address upstream activities like problem definition, requirements development, and software architecture. These prerequisites lay the foundation for a successful project and help minimize costly rework later on.

Risk Reduction. The primary goal of preparation is to reduce risks, especially those related to poor requirements and project planning. By addressing these risks early, project planners can ensure a smoother construction phase and avoid major setbacks.

Cost of Incomplete Preparation. Studies have shown that fixing defects early in the development process is significantly cheaper than fixing them later. Requirements errors detected during architecture can cost three times as much to correct, while post-release fixes can be 10 to 100 times more expensive.

4. Planning is Paramount: Key Construction Decisions

Every programming language has strengths and weaknesses. Be aware of the specific strengths and weaknesses of the language you're using.

Language Choice. The choice of programming language significantly impacts productivity and code quality. Programmers are more productive when using familiar languages and high-level languages that offer greater expressiveness and built-in features.

Programming Conventions. Establishing clear programming conventions before construction begins is essential for maintaining consistency and readability. These conventions should cover naming, commenting, layout, and other aspects of coding style.

Technology Wave. Understanding your position on the technology wave is crucial for adapting your approach. Early-wave environments require more time for troubleshooting and working around limitations, while late-wave environments offer a richer set of tools and resources.

5. Design is Essential: Manage Complexity and Build Quality

If you can't explain something to a six-year-old, you really don't understand it yourself.

Design Challenges. Software design is a "wicked" problem that can only be fully defined by solving it. It's a sloppy process involving tradeoffs, restrictions, and nondeterministic outcomes. The primary goal of design is to manage complexity, both essential and accidental.

Key Design Concepts. Good design depends on understanding key concepts such as abstraction, encapsulation, and information hiding. These concepts help to minimize complexity and create more maintainable and reusable software.

Design Heuristics. Design heuristics are rules of thumb that guide the design process. Common heuristics include finding real-world objects, forming consistent abstractions, encapsulating implementation details, and looking for common design patterns.

6. Classes are King: Build with High-Quality Components

The more you learn about programming, the more you fill your mental toolbox with analytical tools and the knowledge of when to use them and how to use them correctly.

Abstract Data Types (ADTs). Classes are built upon the foundation of abstract data types, which combine data and operations that work on that data. Understanding ADTs is essential for creating well-designed classes that are easier to implement and modify.

Good Class Interfaces. A high-quality class has a well-defined interface that provides a consistent abstraction of the implementation. The interface should be complete, minimal, and designed to hide implementation details.

Design and Implementation Issues. Key considerations in class design include containment, inheritance, member functions and data, class coupling, and constructors. These factors influence the overall quality and maintainability of the class.

7. Routines are the Foundation: Craft Them with Care

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.

Reasons to Create a Routine. Routines are essential for reducing complexity, introducing abstractions, avoiding duplicate code, and improving portability. They also help to hide sequences, pointer operations, and difficult design areas.

Design at the Routine Level. Cohesion is a key principle in routine design, ensuring that all operations within a routine support a central purpose. Functional cohesion, where a routine performs one and only one operation, is the strongest and best kind.

Good Routine Names. A well-chosen routine name clearly describes everything the routine does, avoiding vague verbs and differentiating routines by their specific functions. The name should be as long as necessary to convey its meaning accurately.

8. Defensive Programming: Protect Against the Inevitable

The methodology used should be based on choice of the latest and best, and not based on ignorance. It should also be laced liberally with the old and dependable.

Invalid Inputs. Defensive programming involves protecting your program from invalid inputs by checking data from external sources and routine input parameters. It also requires deciding how to handle bad inputs, whether by returning a neutral value, substituting valid data, logging a warning, or shutting down.

Assertions. Assertions are code used during development to check assumptions and detect unexpected conditions. They help to document code and catch errors early, but should be disabled in production to avoid performance overhead.

Exceptions. Exceptions are a mechanism for handling errors that cannot be addressed locally. They should be used for truly exceptional conditions and thrown at the right level of abstraction to maintain encapsulation.

9. Collaboration is Crucial: Share the Load and Improve Quality

The methodology used should be based on choice of the latest and best, and not based on ignorance. It should also be laced liberally with the old and dependable.

Collaborative Development. Collaborative construction techniques, such as pair programming and formal inspections, are essential for improving software quality. These practices leverage the collective knowledge and perspectives of multiple developers to identify defects and improve code.

Pair Programming. In pair programming, two programmers work together on the same code, with one typing and the other reviewing. This approach improves code quality, shortens schedules, and fosters knowledge sharing.

Formal Inspections. Formal inspections involve a structured review process with defined roles, checklists, and preparation. They are highly effective at detecting defects and can significantly reduce development costs and schedules.

10. Code Tuning: Measure, Then Optimize

We try to solve the problem by rushing through the design process so that enough time is left at the end of the project to uncover the errors that were made because we rushed through the design process.

Performance Overview. Code tuning is a technique for improving a program's performance, but it should be approached strategically. Before tuning, consider factors such as program requirements, design, operating-system interactions, and hardware.

Introduction to Code Tuning. Code tuning involves modifying correct code to make it run more efficiently. It's appealing because it can produce significant performance gains, but it's essential to measure the effect of each tuning to ensure it's beneficial.

Common Sources of Inefficiency. Common sources of inefficiency include input/output operations, paging, system calls, interpreted languages, and errors in the code. Identifying and addressing these bottlenecks can lead to substantial performance improvements.

11. Personal Character: The Bedrock of Software Craftsmanship

The methodology used should be based on choice of the latest and best, and not based on ignorance. It should also be laced liberally with the old and dependable.

Beyond Technical Skills. While technical skills are essential, personal character plays a crucial role in software development. Qualities such as intelligence, humility, curiosity, intellectual honesty, creativity, discipline, and enlightened laziness contribute to a programmer's effectiveness.

Intellectual Honesty. Intellectual honesty involves refusing to pretend expertise, admitting mistakes, understanding compiler warnings, and providing realistic status reports. It's about being truthful and transparent in all aspects of the development process.

Continuous Improvement. Effective programmers are committed to continuous learning and improvement. They seek out new knowledge, experiment with different techniques, and reflect on their experiences to refine their skills and practices.

Last updated:

Review Summary

4.30 out of 5
Average of 9k+ ratings from Goodreads and Amazon.

Code Complete receives mostly positive reviews, praised for its comprehensive coverage of software development best practices. Many consider it essential reading, especially for junior developers. Readers appreciate the focus on managing complexity, writing readable code, and following good design principles. Some criticize its length, verbosity, and outdated examples. Experienced developers find less value, as much content feels obvious. The book's age is noted, with some parts no longer relevant to modern development practices. Overall, it's seen as a valuable resource for learning fundamental software engineering concepts.

Your rating:

About the Author

Steve McConnell is a respected software engineering author and consultant. He is best known for his book "Code Complete," which has become a classic in the field of software development. McConnell has written several other influential books on software project management and development practices. He founded Construx Software, a software development consulting and training company. McConnell's work emphasizes practical, evidence-based approaches to software engineering, drawing from extensive research and industry experience. He has received numerous awards for his contributions to the field, including the Award for Outstanding Contribution to the Software Engineering Literature from the IEEE Computer Society.

Download PDF

To save this Code Complete summary for later, download the free PDF. You can print it out, or read offline at your convenience.
Download PDF
File size: 0.23 MB     Pages: 12

Download EPUB

To read this Code Complete summary on your e-reader device or app, download the free EPUB. The .epub digital book format is ideal for reading ebooks on phones, tablets, and e-readers.
Download EPUB
File size: 2.97 MB     Pages: 11
0:00
-0:00
1x
Dan
Andrew
Michelle
Lauren
Select Speed
1.0×
+
200 words per minute
Create a free account to unlock:
Requests: Request new book summaries
Bookmarks: Save your favorite books
History: Revisit books later
Recommendations: Get personalized suggestions
Ratings: Rate books & see your ratings
Try Full Access for 7 Days
Listen, bookmark, and more
Compare Features Free Pro
📖 Read Summaries
All summaries are free to read in 40 languages
🎧 Listen to Summaries
Listen to unlimited summaries in 40 languages
❤️ Unlimited Bookmarks
Free users are limited to 10
📜 Unlimited History
Free users are limited to 10
Risk-Free Timeline
Today: Get Instant Access
Listen to full summaries of 73,530 books. That's 12,000+ hours of audio!
Day 4: Trial Reminder
We'll send you a notification that your trial is ending soon.
Day 7: Your subscription begins
You'll be charged on Mar 16,
cancel anytime before.
Consume 2.8x More Books
2.8x more books Listening Reading
Our users love us
100,000+ readers
"...I can 10x the number of books I can read..."
"...exceptionally accurate, engaging, and beautifully presented..."
"...better than any amazon review when I'm making a book-buying decision..."
Save 62%
Yearly
$119.88 $44.99/year
$3.75/mo
Monthly
$9.99/mo
Try Free & Unlock
7 days free, then $44.99/year. Cancel anytime.
Settings
Appearance
Black Friday Sale 🎉
$20 off Lifetime Access
$79.99 $59.99
Upgrade Now →