Code complete pdf 2004 download






















Methods of physical tests for hydraulic cement, Part Determination of density. Methods of physical tests for hydraulic cement, Part Determination of air content of hydraulic cement mortar. Method of Non-destructive testing of concrete, Part 1: Ultrasonic pulse velocity. Method of non-destructive testing of concrete-methods of test, Part 2: Rebound hammer. Methods of tests of burnt clay building bricks: Part 1 Determination of compressive strength Part 2 Determination of water absorption Part 3 Determination of efflorescence, Part 4: Determination of warpage.

Requirements for compression testing machine used for testing of concrete and mortar. Method of Test determination of water soluble and acid soluble chlorides in mortar and concrete, Part 1: Fresh mortar and concrete.

Method of Test determination of water soluble and acid soluble chlorides in mortar and concrete, Part 2: Hardened mortar and concrete. Specification for cylinder measures for determination of air content of hydraulic cement mortar. Specification for apparatus for measurement of water retentive of masonry cement.

Specification for cylindrical metal measures for use in tests of aggregates and concrete. Specification for pressure meter for determination of air content of freshly mixed concrete. Specification for apparatus for use in measurement of length change of hardened cement paste, mortar and concrete. Specification for apparatus for measuring aggregate crushing value and ten percent fines value.

Method of making, curing and determining compressive strength of accelerated cured concrete test specimens. Code of practice for determination of specific surface area of powders by air permeability methods. Method of test for determining setting time of concrete by penetration resistance.

Dimensions and materials of cement rotary kilns, components and auxiliaries dry process with suspension preheater. Code of practice for extreme weather concreting, Part 2: Recommended practice for cold weather concreting. Can you derive something useful from the data? Can you think of other data appropriate for determining the unknown?

Can you change the unknown or the data, or both if necessary, so that the new unknown and the new data are nearer to each other? Did you use all the data? Did you use the whole condition? Have you taken into account all essential notions involved in the problem? Carrying out the Plan. Carry out your plan. Carrying out your plan of the solution, check each step. Can you see clearly that the step is correct?

Can you prove that it's correct? Looking Back. Examine the solution. Can you check the result? Can you check the argument? Can you derive the result differently? Can you see it at a glance? Can you use the result, or the method, for some other problem?

Figure G. Write a short test pro- gram. Try a completely different approach. Think of a brute-force solution. Keep outlining and sketching with your pencil, and your brain will follow. If all else fails, walk away from the problem.

Literally go for a walk, or think about something else before returning to the problem. Why fight your way through the last 20 percent of the design when it will drop into place easily the next time through? Why make bad decisions based on limited experience with the design when you can make good deci- sions based on more experience with it later? This section describes design practice heuris- tics, steps you can take that often produce good results. Iterate You might have had an experience in which you learned so much from writing a pro- gram that you wished you could write it again, armed with the insights you gained from writing it the first time.

The same phenomenon applies to design, but the design cycles are shorter and the effects downstream are bigger, so you can afford to whirl through the design loop a few times. Design is an iterative process. The big picture you get from working with high- level issues will help you to put the low-level details in perspective.

The details you get from working with low-level issues will provide a foundation in solid reality for the high-level decisions. Many programmers—many people, for that matter—have trouble ranging between high- level and low-level considerations. For more on this, see Chapter attempt that can improve your overall design. After trying a thousand different mate- 24, "Refactoring.

Divide the program into different areas of concern, and then tackle each of those areas individually. If you run into a dead end in one of the areas, iterate! Incremental refinement is a powerful tool for managing complexity. As Polya recom- mended in mathematical problem solving, understand the problem, devise a plan, carry out the plan, and then look back to see how you did Polya Top-down design begins at a high level of abstraction.

You define base classes or other nonspecific design ele- ments. As you develop the design, you increase the level of detail, identifying derived classes, collaborating classes, and other detailed design elements. Bottom-up design starts with specifics and works toward generalities. It typically begins by identifying concrete objects and then generalizes aggregations of objects and base classes from those specifics.

Here are the arguments on both sides. The divide-and-conquer process is iterative in a couple of senses. You keep going for several levels. You decompose a program one way. You make a choice and see what hap- pens. Then you start over and decompose it another way and see whether that works better.

How far do you decompose a program? Continue decomposing until it seems as if it would be easier to code the next level than to decompose it.

Work until you become somewhat impatient at how obvious and easy the design seems. If you need to work with something more tangible, try the bottom-up design approach. You might identify a few low-level responsibilities that you can assign to concrete classes. For example, you might know that a system needs to format a partic- ular report, compute data for that report, center its headings, display the report on the screen, print the report on a printer, and so on.

In some other cases, major attributes of the design problem are dictated from the bot- tom. You might have to interface with hardware devices whose interface requirements dictate large chunks of your design.

One starts from the general problem and breaks it into manageable pieces; the other starts with manageable pieces and builds up a general solution. People are good at breaking some- thing big into smaller components, and programmers are especially good at it.

Another strength of top-down design is that you can defer construction details. One strength of the bottom-up approach is that it typically results in early identifica- tion of needed utility functionality, which results in a compact, well-factored design.

Most people are better at taking one big concept and breaking it into smaller concepts than they are at taking small concepts and making one big one.

To summarize, top down tends to start simple, but sometimes low-level complexity ripples back to the top, and those ripples can make things more complex than they really needed to be. Design is a heuristic process, which means that no solu- tion is guaranteed to work every time. Design contains elements of trial and error. Try a variety of approaches until you find one that works well. You might not know if a particular database orga- nization will work until you know whether it will meet your performance goals.

A general technique for addressing these questions at low cost is experimental proto- typing. You just need to know enough to approximate the problem space—number of tables, number of entries in the tables, and so on. You can then write very simple prototyping code that uses tables with names like Table1, Table2, and Column1, and Column2, populate the tables with junk data, and do your performance testing.

Prototyping also works poorly when the design question is not specific enough. A final risk of prototyping arises when developers do not treat the code as throwaway code. I have found that it is not possible for people to write the absolute minimum amount of code to answer a question if they believe that the code will eventually end up in the production system. They end up implementing the system instead of proto- typing. By adopting the attitude that once the question is answered the code will be thrown away, you can minimize this risk.

One way to avoid this problem is to create prototypes in a different technology than the production code. If you do create prototypes using the production technology, a practical standard that can help is requiring that class names or package names for prototype code be prefixed with prototype. That at least makes a programmer think twice before trying to extend pro- totype code Stephens Used without discipline, prototyping adds some wickedness of its own. Collaborative Design Cross-Reference For more In design, two heads are often better than one, whether those two heads are organized details on collaborative devel- formally or informally.

You will have forgot- ten enough that you should be able to give yourself a fairly good review. If the goal is quality assurance, I tend to recommend the most structured review prac- tice, formal inspections, for the reasons described in Chapter But if the goal is to foster creativity and to increase the number of design alternatives generated, not just to find errors, less structured approaches work better. How Much Design Is Enough? We try to solve the problem Sometimes only the barest sketch of an architecture is mapped out before coding by rushing through the begins.

Other times, teams create designs at such a level of detail that coding design process so that enough time is left at the becomes a mostly mechanical exercise. How much design should you do before you end of the project to uncover begin coding? Do you need formal, polished the design process.

The experience of the team, expected lifetime of the system, desired level of reliability, and size of project and team should all be considered. Table summarizes how each of these factors influence the design approach. Application is High Detail High Formality safety-critical. Project is small.

Low Detail Low Formality Project is large. Software is expected to Medium Detail Medium Formality have a long lifetime months or years. Two or more of these factors might come into play on any specific project, and in some cases the factors might provide contradictory advice. For example, you might have a highly experienced team working on safety critical software. I rarely encounter projects that are suffering from having done too much design work.

I've never met a human On the other hand, occasionally I have seen projects that are suffering from too much being who would want to design documentation. A premature rush to polish a design I'd kill him to get him out of description is a good example of that law. I would rather see 80 percent of the design the gene pool.

Capturing Your Design Work cc2e. However, you can capture designs in numerous alternative ways that work well on small projects, informal projects, or projects that need a light- weight way to record a design: The bad news is that, in our Insert design documentation into the code itself Document key design decisions in opinion, we will never find the code comments, typically in the file or class header.

We will never find a process that allows with a documentation extractor like JavaDoc, this assures that design documentation us to design software in a per- will be readily available to a programmer working on a section of code, and it fectly rational way.

The good improves the chance that programmers will keep the design documentation reason- news is that we can fake it. Clements Capture design discussions and decisions on a Wiki Have your design discussions in writing, on a project Wiki that is, a collection of Web pages that can be edited eas- ily by anyone on your project using a Web browser.

This will capture your design dis- cussions and decision automatically, albeit with the extra overhead of typing rather than talking. You can also use the Wiki to capture digital pictures to supplement the text discussion, links to websites that support the design decision, white papers, and other materials.

This technique is especially useful if your development team is geo- graphically distributed. Write e-mail summaries After a design discussion, adopt the practice of designating someone to write a summary of the discussion—especially what was decided—and send it to the project team.

If you make your design drawings on large flip chart paper, you can simply archive the flip charts in a convenient location—or, better yet, post them on the walls around the project area so that people can easily refer to them and update them when needed. On each card, designers write a class name, responsibilities of the class, and collaborators other classes that cooperate with the class.

At that point, you can simply save the cards for future reference. Index cards are cheap, unintimidating, and portable, and they encourage group interaction Beck Figure earlier in this chapter was one example of a UML class diagram. UML provides a rich set of formalized rep- resentations for design entities and relationships. You can use informal versions of UML to explore and discuss design approaches.

Because UML is standard- ized, it supports common understanding in communicating design ideas and it can accelerate the process of considering design alternatives when working in a group. These techniques can work in various combinations, so feel free to mix and match these approaches on a project-by-project basis or even within different areas of a single project.

When I published the first edition of Code Complete in the early s, design zealots were advocating dotting every design i and crossing every design t before beginning coding. Additional Resources People who preach software As I write this edition in the mids, some software swamis are arguing for not design as a disciplined activ- doing any design at all.

But my bet is that call perfectly. The two positions advocated by will ever acknowledge. Plauger extremists on both ends of the scale turn out to be the only two positions that are always wrong! Treat design as a wicked, sloppy, heuristic process.

Strive for simplicity. Prototype when you need to. Iterate, iterate, and iter- ate again. Additional Resources cc2e. The challenge is identifying which resources will be most useful. Here are some suggestions. Software Design, General Weisfeld, Matt. The Object-Oriented Thought Process, 2d ed. SAMS, This is an accessible book that introduces object-oriented programming. Riel, Arthur J. Object-Oriented Design Heuristics. Reading, MA: Addison-Wesley, This book is easy to read and focuses on design at the class level.

Plauger, P. Programming on Purpose: Essays on Software Design. Object-Oriented Software Construction, 2d ed. Meyer presents a forceful advocacy of hard-core object-oriented programming. Raymond, Eric S. Boston, MA: Addison-Wesley, This is a well-researched look at software design through UNIX-colored glasses. Section 1. Larman, Craig. This book is a popular introduction to object-oriented design in the context of the Unified Process.

It also discusses object-oriented analysis. This classic article describes the gap between how programs are really designed and how you sometimes wish they were designed. The main point is that no one ever really goes through a rational, orderly design process but that aiming for it makes for better designs in the end. Most software- engineering textbooks discuss it briefly, frequently in the context of object-oriented techniques.

The three Parnas papers listed below are the seminal presentations of the idea and are probably still the best resources on information hiding.

Parnas, David L. Clements, and D. Design Patterns Gamma, Erich, et al. Design Patterns. Shalloway, Alan, and James R. Design Patterns Explained.

Boston, MA: Addison- Wesley, This book contains an easy-to-read introduction to design patterns. Cambridge, MA: Perseus Publishing, Although not specifically about software design, this book was written to teach design to engineering students at Stanford.

Even if you never design anything, the book is a fascinating discussion of creative thought pro- cesses. It includes many exercises in the kinds of thinking required for effective design. It also contains a well-annotated bibliography on design and creative thinking.

Polya, G. This discussion of heuristics and problem solving focuses on mathematics but is applicable to software development. At one time, Microsoft gave this book to all its new programmers.

Michalewicz, Zbigniew, and David B. How to Solve It: Modern Heuristics. Berlin: Springer-Verlag, Simon, Herbert. The Sciences of the Artificial, 3d ed. This fascinating book draws a distinction between sciences that deal with the natural world biology, geology, and so on and sciences that deal with the artificial world cre- ated by humans business, architecture, and computer science.

It then discusses the characteristics of the sciences of the artificial, emphasizing the science of design. Glass, Robert L. Software Creativity. Is software development controlled more by theory or by practice? Is it primarily cre- ative or is it primarily deterministic? What intellectual qualities does a software devel- oper need? This book contains an interesting discussion of the nature of software development with a special emphasis on design.

Petroski, Henry. Cambridge: Cambridge University Press, This book draws heavily from the field of civil engineering especially bridge design to explain its main argument that successful design depends at least as much upon learning from past failures as from past successes.

It describes what should be included in a software-design document. IEEE Std Are all of its parts strictly necessary?

This is greatly aided by a design focus on simplicity. Dogmatic adherence to any single methodology hurts cre- ativity and hurts your programs. The perspectives presented here are just the tip of the iceberg.

See ADTs — simple items as, Abstract Factory pattern, locking, verification of code benefit, abstraction parallelism from, agile development, 58, access routines for, — requiring, algebraic identities, ADTs for.

See iteration in guidelines for creating class cooling system example, — development interfaces, — data, meaning of, premature optimization problem, high-level problem domain terms, defined, documentation benefit, quality control, See also implementation structures, explicit instancing, quality of software low-level, files as, resources for, 58—59 inconsistent, —, guidelines, — sequential approach, 35—36 interfaces, goals for, — hiding information with, team processes, — levels of, — instancing, top-down approaches, —, opposites, pairs of, implicit instancing, — OS level, interfaces, making more architecture patterns for, informative, building block definition, 45 placing items in inheritance trees, low-level data types as, business rules, 46 media independence with, buying vs.

See debugging; defects in code; engineering tools, numeric, structuring, — errors case statements parentheses for clarifying, build tools, — See also alpha ordering, — compilers checklist, pointers, comparisons with, building metaphor, 16—19 debugging, positive form recommended, building vs. See daily build and drop-throughs, — refactoring, smoke tests end of case statements, — short circuit evaluation, — business rules endline layout, — simplifying, — architecture prerequisites, 46 error detection in, variables in.

See boolean assertion example, table-driven methods using, expressions boolean expression syntax, — identifiers for, — — change control. See configuration naming, — debugging stubs with, — management simplifying tests with, — description of, 64 character arrays, — See also zeros and ones as values, DoNothing macros, — string data types boss readiness test on prerequisites, exceptions in, — character data types 30—31 inline routines, — arrays vs.

See functions; backups, table-driven methods, routines boolean expressions, testing, , global data, hiding, case statements, tools, 70 god classes, character data types, — type creation, hacking approach to, classes, —, —, variables, —, —, hiding implementation details, —, , — coding practices, 69 circular dependencies, 95 implementation checklist, code tuning, —, — classes indirect calls to other classes, comments, , — abstract data types.

See ADTs information hiding, 92—93 conditional statements, abstract objects, modeling, inheritance, —, configuration management, abstraction checklist, initializing members, — alternates to PPP, — integration, , , constants, architecture prerequisites, 46 irrelevant classes, construction practices, 69—70 assumptions about users, is a relationships, control structures, , , base. See also preceding code rule, subexpression elimination, collaboration proportionality of, — comments.

See also construction; checklists, , — style violations, software construction overview classes, summaries of code, conventions. See conventions, coded meanings, — surprises, coding control structures, —, tricky code, , practices checklist, 69 declarations with, , —, undocumented features, sequential.

See straight-line code variables, software construction as, 5 descriptions of code intent, version control, style. See layout distance to code guideline, why vs.

See boolean tests comparisons of techniques, table individual lines with, — floating-point equality, — of, — input data, , mixed data types, cost advantage, — integrating into development, compilers defined, , interfaces, class, binding during compilation, design phase, interfaces, routine, — development time benefit, Javadoc, , broken builds, dog-and-pony shows, key points, data type warnings, extending beyond construction, layout guidelines, — debugging tools, as, , legal notices, errors, finding in routines, Extreme Programming method, length of descriptions, — level of code intent, — line numbers, debugging with, formal inspections.

See formal loops, — inspections maintenance of, , —, messages, treatment of, , General Principle of Software — Quality, major vs. See formal markers, optimizations by, — inspections non-code essential information, performance tuning key points, considerations, mentoring aspect of, numerical data, project-wide standards for, pair programming.

See structures — simulating in languages lacking, complexity frequency, testing in order of, abstraction for handling, — construction. See also software classes for reducing, if statements. See if statements construction overview coding conventions for reducing, key points, collaborative. See collaboration lookup tables, substituting, decisions. See construction control structure contributions to, — decisions — looping, conditional. See loops guidelines, 66 conventions for managing, normal case first guideline, managing.

See managing — — construction decision points, counting, normal path first guideline, percent of total activity, by size of importance of, null if clauses, project, — isolation, classes for, plain if-then statements, — prerequisites. See prerequisites, live time, refactoring, upstream management, 77—79, — short-circuit evaluation, quality of. See case resources on, mental objects held, measure of, statements schedules, estimating.

See confessional debugging, — construction schedules, methods for handling, — configuration management estimating minimization goal, 80 architectural anticipation of size of projects, effects on.

See size patterns, reducing with, change, 52 of projects problem domain, working at, backup plans, , tools for. See programming tools reliability correlated with, boards, change-control, construction decisions routines for reducing, bureaucratic considerations, checklist of major construction size of projects, effect on, checklist, — practices, 69—70 — code changes, — coding practices checklist, 69 span, cost, estimating, early-wave environments, 67 component testing, defined, key points for, 70 components, buying, 18, 51 design changes, — major construction practices, Composite pattern, estimating change costs, selecting, 69—70 compound boundaries, grouping change requests, mature technology environments, compound statements.

EMBED for wordpress. Want more? Advanced embedding details, examples, and help! Publication date Usage Attribution-NonCommercial 4. Org Language English.

In order to promote public education and public safety, equal justice for all, a better informed citizenry, the rule of law, world trade and world peace, this legal document is hereby made available on a noncommercial basis, as it is the right of all humans to know and speak the laws that govern them.

There are no reviews yet. I already own two copies of the original Code Complete; one for work, one for home. There's a list of what changed in the new edition , if you're curious: There are still far more people who talk about good practices than who actually use good practices. I see far too many people using current buzzwords as a cloak for sloppy practices.



0コメント

  • 1000 / 1000