Code Complete

Widely considered one of the best practical guides to programming, Steve McConnell’s original CODE COMPLETE has been helping developers write better software for more than a decade. Now this classic book has been fully updated and revised with leading-edge practices—and hundreds of new code samples—illustrating the art and science of software construction. Capturing the body of knowledge available from research, academia, and everyday commercial practice, McConnell synthesizes the most effective techniques and must-know principles into clear, pragmatic guidance. No matter what your experience level, development environment, or project size, this book will inform and stimulate your thinking—and help you build the highest quality code.
Discover the timeless techniques and strategies that help you:

  • Design for minimum complexity and maximum creativity
  • Reap the benefits of collaborative development
  • Apply defensive programming techniques to reduce and flush out errors
  • Exploit opportunities to refactor—or evolve—code, and do it safely
  • Use construction practices that are right-weight for your project
  • Debug problems quickly and effectively
  • Resolve critical construction issues early and correctly
  • Build quality into the beginning, middle, and end of your project
1100354307
Code Complete

Widely considered one of the best practical guides to programming, Steve McConnell’s original CODE COMPLETE has been helping developers write better software for more than a decade. Now this classic book has been fully updated and revised with leading-edge practices—and hundreds of new code samples—illustrating the art and science of software construction. Capturing the body of knowledge available from research, academia, and everyday commercial practice, McConnell synthesizes the most effective techniques and must-know principles into clear, pragmatic guidance. No matter what your experience level, development environment, or project size, this book will inform and stimulate your thinking—and help you build the highest quality code.
Discover the timeless techniques and strategies that help you:

  • Design for minimum complexity and maximum creativity
  • Reap the benefits of collaborative development
  • Apply defensive programming techniques to reduce and flush out errors
  • Exploit opportunities to refactor—or evolve—code, and do it safely
  • Use construction practices that are right-weight for your project
  • Debug problems quickly and effectively
  • Resolve critical construction issues early and correctly
  • Build quality into the beginning, middle, and end of your project
35.99 In Stock
Code Complete

Code Complete

by Steve McConnell
Code Complete

Code Complete

by Steve McConnell

eBook

$35.99  $47.99 Save 25% Current price is $35.99, Original price is $47.99. You Save 25%.

Available on Compatible NOOK devices, the free NOOK App and in My Digital Library.
WANT A NOOK?  Explore Now

Related collections and offers


Overview

Widely considered one of the best practical guides to programming, Steve McConnell’s original CODE COMPLETE has been helping developers write better software for more than a decade. Now this classic book has been fully updated and revised with leading-edge practices—and hundreds of new code samples—illustrating the art and science of software construction. Capturing the body of knowledge available from research, academia, and everyday commercial practice, McConnell synthesizes the most effective techniques and must-know principles into clear, pragmatic guidance. No matter what your experience level, development environment, or project size, this book will inform and stimulate your thinking—and help you build the highest quality code.
Discover the timeless techniques and strategies that help you:

  • Design for minimum complexity and maximum creativity
  • Reap the benefits of collaborative development
  • Apply defensive programming techniques to reduce and flush out errors
  • Exploit opportunities to refactor—or evolve—code, and do it safely
  • Use construction practices that are right-weight for your project
  • Debug problems quickly and effectively
  • Resolve critical construction issues early and correctly
  • Build quality into the beginning, middle, and end of your project

Product Details

ISBN-13: 9780735636972
Publisher: Pearson Education
Publication date: 06/09/2004
Series: Developer Best Practices
Sold by: Barnes & Noble
Format: eBook
Pages: 960
File size: 4 MB
Age Range: 18 Years

About the Author

Steve McConnell is recognized as one of the premier authors and voices in the development community. He is Chief Software Engineer of Construx Software and was the lead developer of Construx Estimate and of SPC Estimate Professional, winner of Software Development magazine's Productivity Award. He is the author of several books, including Code Complete and Rapid Development, both honored with Software Development magazine's Jolt Award.

Read an Excerpt


From Chapter 20: Programming Tools

...20.6 Ideal Programming Environment

This section's description of an ideal programming environment is an excursion into programming fantasyland. Although such a vision is not immediately practical, this book about construction has a responsibility to define where construction tools should be going. All of the capabilities described in this section are easily within the reach of today's technology. Perhaps the description will serve as inspiration for an ambitious toolsmith who will create a programming environment that towers above the ones currently available.

For this discussion, the fantasy environment is called "Cobbler." The name is inspired by the old saying that the cobbler's children are the last to have new shoes, which is true of today's programmers and programming tools.

Integration

The Cobbler environment integrates the programming activities of detailed design, coding, and debugging. When source-code control is needed, Cobbler integrates source-code version control too. If the detailed-design practices suggested in this book are followed, the primary detailed-design tool required is PDL, which can be handled easily, even in text environments.

Language support

During code construction, Cobbler provides ready access to cross-referenced help on the programming language. Help discusses nuances of the language as well as the basics and mentions common problems in using features of the language. For error messages, Help lists the common problems that might give rise to each message.

The environment provides templates for language constructs so that youdon't need to remember the precise syntax for a case statement, a for loop, or a more unusual construct. The help systems provides a well-organized list of all available routines, and you can paste the template for a routine into your code.

Detailed cross-referencing

Cobbler enables you to generate a list of all the places in which a variable is used or receives a value. You can get help on a variable declaration the same way you's get help on any other topic, with ready access to the variable definition and comments about it.

You can retrieve information on routines just as easily. You can follow a chain of calls to routines up and down--pointing at the name of the routine you want to view in more detail. You can check variable types in a call to a routine with the touch of key.

Interactive views of program organization

The Cobbler environment radically changes the way you view program source text. Compilers read source files from beginning to end, and traditional development environments force you to view a program the same way. This is sequential and flat--far from what you need for a meaningful view of a program.

In Cobbler, you can view a tangle of routine names, graphically presented, and zoom in on any routine. You can choose the model that organizes the tangle of routines: hierarchy, network, modules, objects, or an alphabetical listing. Your high-level view isn't cluttered by a routine's details until you want to zoom in on them.

When looking at the guts of a routine, you can view them at any of several levels of detail. You can view only the routine's definition or only the comment prolog. You can view code only or comments only. You can view control structures with or without a display of the code they control. In languages with macro commands, you can view a program with the macros expanded or contracted. If they're contracted, you can expend an individual macro with the touch of a key.

In writing this book, I've used a word processor with a powerful outline view. Without the outline view and the ability to study an outline and then zoom in on its detailed contents, I'd have a weak sense of each chapter's structure. The only view I'd see of each chapter would be flat, and the only sense of structure I'd have would come from scrolling from beginning to end. The ability to zoom between low-level and high-level views gives me a sense of the topology of each chapter, and that's critical to organizing my writing.

Organizing source code is as difficult as organizing writing. It's hard to believe that I lack any capability whatsoever to view the topology of my programs, especially when I've had a similar capability in my writing tools for more than five years.

The kinds of components that make up a program can also be improved. The semantics of source files are hazy, and the concept is better replaced by the ideas of modules, packages, or objects. The concept of source files is obsolete. You should be able to think about the semantics of your programs without worrying about how the code is physically stored.

Interactive formatting

Cobbler provides more active formatting aids than existing environments do. For example, it's graphical user interface makes outer parentheses larger than inner parentheses, as they have been displayed in mathematical texts for a hundred years.

The environment formats code according to user-specified parameters without resorting to a separate pretty-primer program. Any environment that knows about your program already knows where all your logical structures and variable declarations are. In Cobbler, you don't need to resort to a separate program to format your code. Some current environments provide feeble support for automatic indentation of control structures as you enter them. But when they're modified and 45 lines need to be shifted out six columns each, you're on your own. In the ideal programming environment, the environment formats the code according to the code's logical structure. If you change the logical structure, the environment reformats the code accordingly...

Table of Contents

Prefacexix
Acknowledgmentsxxvii
List of Checklistsxxix
List of Tablesxxxi
List of Figuresxxxiii
Part ILaying the Foundation
1Welcome to Software Construction3
1.1What Is Software Construction?3
1.2Why Is Software Construction Important?6
1.3How to Read This Book8
2Metaphors for a Richer Understanding of Software Development9
2.1The Importance of Metaphors9
2.2How to Use Software Metaphors11
2.3Common Software Metaphors13
3Measure Twice, Cut Once: Upstream Prerequisites23
3.1Importance of Prerequisites24
3.2Determine the Kind of Software You're Working On31
3.3Problem-Definition Prerequisite36
3.4Requirements Prerequisite38
3.5Architecture Prerequisite43
3.6Amount of Time to Spend on Upstream Prerequisites55
4Key Construction Decisions61
4.1Choice of Programming Language61
4.2Programming Conventions66
4.3Your Location on the Technology Wave66
4.4Selection of Major Construction Practices69
Part IICreating High-Quality Code
5Design in Construction73
5.1Design Challenges74
5.2Key Design Concepts77
5.3Design Building Blocks: Heuristics87
5.4Design Practices110
5.5Comments on Popular Methodologies118
6Working Classes125
6.1Class Foundations: Abstract Data Types (ADTs)126
6.2Good Class Interfaces133
6.3Design and Implementation Issues143
6.4Reasons to Create a Class152
6.5Language-Specific Issues156
6.6Beyond Classes: Packages156
7High-Quality Routines161
7.1Valid Reasons to Create a Routine164
7.2Design at the Routine Level168
7.3Good Routine Names171
7.4How Long Can a Routine Be?173
7.5How to Use Routine Parameters174
7.6Special Considerations in the Use of Functions181
7.7Macro Routines and Inline Routines182
8Defensive Programming187
8.1Protecting Your Program from Invalid Inputs188
8.2Assertions189
8.3Error-Handling Techniques194
8.4Exceptions198
8.5Barricade Your Program to Contain the Damage Caused by Errors203
8.6Debugging Aids205
8.7Determining How Much Defensive Programming to Leave in Production Code209
8.8Being Defensive About Defensive Programming210
9The Pseudocode Programming Process215
9.1Summary of Steps in Building Classes and Routines216
9.2Pseudocode for Pros218
9.3Constructing Routines by Using the PPP220
9.4Alternatives to the PPP232
Part IIIVariables
10General Issues in Using Variables237
10.1Data Literacy238
10.2Making Variable Declarations Easy239
10.3Guidelines for Initializing Variables240
10.4Scope244
10.5Persistence251
10.6Binding Time252
10.7Relationship Between Data Types and Control Structures254
10.8Using Each Variable for Exactly One Purpose255
11The Power of Variable Names259
11.1Considerations in Choosing Good Names259
11.2Naming Specific Types of Data264
11.3The Power of Naming Conventions270
11.4Informal Naming Conventions272
11.5Standardized Prefixes279
11.6Creating Short Names That Are Readable282
11.7Kinds of Names to Avoid285
12Fundamental Data Types291
12.1Numbers in General292
12.2Integers293
12.3Floating-Point Numbers295
12.4Characters and Strings297
12.5Boolean Variables301
12.6Enumerated Types303
12.7Named Constants307
12.8Arrays310
12.9Creating Your Own Types (Type Aliasing)311
13Unusual Data Types319
13.1Structures319
13.2Pointers323
13.3Global Data335
Part IVStatements
14Organizing Straight-Line Code347
14.1Statements That Must Be in a Specific Order347
14.2Statements Whose Order Doesn't Matter351
15Using Conditionals355
15.1if Statements355
15.2Case Statements361
16Controlling Loops367
16.1Selecting the Kind of Loop367
16.2Controlling the Loop373
16.3Creating Loops Easily--From the Inside Out385
16.4Correspondence Between Loops and Arrays387
17Unusual Control Structures391
17.1Multiple Returns from a Routine391
17.2Recursion393
17.3goto398
17.4Perspective on Unusual Control Structures408
18Table-Driven Methods411
18.1General Considerations in Using Table-Driven Methods411
18.2Direct Access Tables413
18.3Indexed Access Tables425
18.4Stair-Step Access Tables426
18.5Other Examples of Table Lookups429
19General Control Issues431
19.1Boolean Expressions431
19.2Compound Statements (Blocks)443
19.3Null Statements444
19.4Taming Dangerously Deep Nesting445
19.5A Programming Foundation: Structured Programming454
19.6Control Structures and Complexity456
Part VCode Improvements
20The Software-Quality Landscape463
20.1Characteristics of Software Quality463
20.2Techniques for Improving Software Quality466
20.3Relative Effectiveness of Quality Techniques469
20.4When to Do Quality Assurance473
20.5The General Principle of Software Quality474
21Collaborative Construction479
21.1Overview of Collaborative Development Practices480
21.2Pair Programming483
21.3Formal Inspections485
21.4Other Kinds of Collaborative Development Practices492
22Developer Testing499
22.1Role of Developer Testing in Software Quality500
22.2Recommended Approach to Developer Testing503
22.3Bag of Testing Tricks505
22.4Typical Errors517
22.5Test-Support Tools523
22.6Improving Your Testing528
22.7Keeping Test Records529
23Debugging535
23.1Overview of Debugging Issues535
23.2Finding a Defect540
23.3Fixing a Defect550
23.4Psychological Considerations in Debugging554
23.5Debugging Tools--Obvious and Not-So-Obvious556
24Refactoring563
24.1Kinds of Software Evolution564
24.2Introduction to Refactoring565
24.3Specific Refactorings571
24.4Refactoring Safely579
24.5Refactoring Strategies582
25Code-Tuning Strategies587
25.1Performance Overview588
25.2Introduction to Code Tuning591
25.3Kinds of Fat and Molasses597
25.4Measurement603
25.5Iteration605
25.6Summary of the Approach to Code Tuning606
26Code-Tuning Techniques609
26.1Logic610
26.2Loops616
26.3Data Transformations624
26.4Expressions630
26.5Routines639
26.6Recoding in a Low-Level Language640
26.7The More Things Change, the More They Stay the Same643
Part VISystem Considerations
27How Program Size Affects Construction649
27.1Communication and Size650
27.2Range of Project Sizes651
27.3Effect of Project Size on Errors651
27.4Effect of Project Size on Productivity653
27.5Effect of Project Size on Development Activities654
28Managing Construction661
28.1Encouraging Good Coding662
28.2Configuration Management664
28.3Estimating a Construction Schedule671
28.4Measurement677
28.5Treating Programmers as People680
28.6Managing Your Manager686
29Integration689
29.1Importance of the Integration Approach689
29.2Integration Frequency--Phased or Incremental?691
29.3Incremental Integration Strategies694
29.4Daily Build and Smoke Test702
30Programming Tools709
30.1Design Tools710
30.2Source-Code Tools710
30.3Executable-Code Tools716
30.4Tool-Oriented Environments720
30.5Building Your Own Programming Tools721
30.6Tool Fantasyland722
Part VIISoftware Craftsmanship
31Layout and Style729
31.1Layout Fundamentals730
31.2Layout Techniques736
31.3Layout Styles738
31.4Laying Out Control Structures745
31.5Laying Out Individual Statements753
31.6Laying Out Comments763
31.7Laying Out Routines766
31.8Laying Out Classes768
32Self-Documenting Code777
32.1External Documentation777
32.2Programming Style as Documentation778
32.3To Comment or Not to Comment781
32.4Keys to Effective Comments785
32.5Commenting Techniques792
32.6IEEE Standards813
33Personal Character819
33.1Isn't Personal Character Off the Topic?820
33.2Intelligence and Humility821
33.3Curiosity822
33.4Intellectual Honesty826
33.5Communication and Cooperation828
33.6Creativity and Discipline829
33.7Laziness830
33.8Characteristics That Don't Matter As Much As You Might Think830
33.9Habits833
34Themes in Software Craftsmanship837
34.1Conquer Complexity837
34.2Pick Your Process839
34.3Write Programs for People First, Computers Second841
34.4Program into Your Language, Not in It843
34.5Focus Your Attention with the Help of Conventions844
34.6Program in Terms of the Problem Domain845
34.7Watch for Falling Rocks848
34.8Iterate, Repeatedly, Again and Again850
34.9Thou Shalt Rend Software and Religion Asunder851
35Where to Find More Information855
35.1Information About Software Construction856
35.2Topics Beyond Construction857
35.3Periodicals859
35.4A Software Developer's Reading Plan860
35.5Joining a Professional Organization862
Bibliography863
Index885
From the B&N Reads Blog

Customer Reviews