All of this is quoted from The Pragmatic Programmer‘s appendices.
Why spend your life developing software unless you care about doing it well?
Turn off the autopilot and take control. Constantly critique and appraise your work.
Instead of excuses, provide options. Don’t say it can’t be done; explain what can be done.
Fix bad designs, wrong decisions, and poor code when you see them.
You can’t force change on people. Instead, show them how the future might be and help them participate in creating it.
Don’t get so engrossed in the details that you forget to check what’s happening around you.
Involve your users in determining the project’s real quality requirements.
Make learning a habit.
Don’t be swayed by vendors, media hype, or dogma. Analyze information in terms of you and your project.
There’s no point in having great ideas if you don’t communicate them effectively.
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
If it’s easy to reuse, people will. Create an environment that supports reuse.
Design components that are self-contained, independent, and have a single, well-defined purpose.
No decision is cast in stone. Instead, consider each as being written in the sand at the beach, and plan for change.
Tracer bullets let you home in on your target by trying things and seeing how close they land.
Prototyping is a learning experience. Its value lies not in the code you produce, but in the lessons you learn.
Design and code in your user’s language.
Estimate before you start. You’ll spot potential problems up front.
Use experience you gain as you implement to refine the project time scales.
Plain text won’t become obsolete. It helps leverage your work and simplifies debugging and testing.
Use the shell when graphical user interfaces don’t cut it.
The editor should be an extension of your hand; make sure your editor is configurable, extensible, and programmable.
Source code control is a time machine for your work—you can go back.
It doesn’t really matter whether the bug is your fault or someone else’s—it is still your problem, and it still needs to be fixed.
Take a deep breath and THINK! about what could be causing the bug.
It is rare to find a bug in the OS or the compiler, or even a third-party product or library. The bug is most likely in the application.
Prove your assumptions in the actual environment—with real data and boundary conditions.
You spend a large part of each day working with text. Why not have the computer do some of it for you?
Code generators increase your productivity and help avoid duplication.
Software can’t be perfect. Protect your code and users from the inevitable errors.
Use contracts to document and verify that code does no more and no less than it claims to do.
A dead program normally does a lot less damage than a crippled one.
Assertions validate your assumptions. Use them to protect your code from an uncertain world.
Exceptions can suffer from all the readability and maintainability problems of classic spaghetti code. Reserve exceptions for exceptional things.
Where possible, the routine or object that allocates a resource should be responsible for deallocating it.
Avoid coupling by writing “shy” code and applying the Law of Demeter.
Implement technology choices for an application as configuration options, not through integration or engineering.
Program for the general case, and put the specifics outside the compiled code base.
Exploit concurrency in your user’s workflow.
Design in terms of services—independent, concurrent objects behind well-defined, consistent interfaces.
Allow for concurrency, and you’ll design cleaner interfaces with fewer assumptions.
Gain flexibility at low cost by designing your application in terms of models and views.
Use blackboards to coordinate disparate facts and agents, while maintaining independence and isolation among participants.
Rely only on reliable things. Beware of accidental complexity, and don’t confuse a happy coincidence with a purposeful plan.
Get a feel for how long things are likely to take before you write code.
Mathematical analysis of algorithms doesn’t tell you everything. Try timing your code in its target environment.
Just as you might weed and rearrange a garden, rewrite, rework, and re-architect code when it needs it. Fix the root of the problem.
Start thinking about testing before you write a line of code.
Test ruthlessly. Don’t make your users find bugs for you.
Wizards can generate reams of code. Make sure you understand all of it before you incorporate it into your project.
Requirements rarely lie on the surface. They’re buried deep beneath layers of assumptions, misconceptions, and politics.
It’s the best way to gain insight into how the system will really be used.
Invest in the abstraction, not the implementation. Abstractions can survive the barrage of changes from different implementations and new technologies.
Create and maintain a single source of all the specific terms and vocabulary for a project.
When faced with an impossible problem, identify the real constraints. Ask yourself: “Does it have to be done this way? Does it have to be done at all?”
You’ve been building experience all your life. Don’t ignore niggling doubts.
Don’t fall into the specification spiral—at some point you need to start coding.
Don’t blindly adopt any technique without putting it into the context of your development practices and capabilities.
Beware of vendor hype, industry dogma, and the aura of the price tag. Judge tools on their merits.
Don’t separate designers from coders, testers from data modelers. Build teams the way you build code.
A shell script or batch file will execute the same instructions, in the same order, time after time.
Tests that run with every build are much more effective than test plans that sit on a shelf.
Introduce bugs on purpose in a separate copy of the source to verify that testing will catch them.
Identify and test significant program states. Just testing lines of code isn’t enough.
Once a human tester finds a bug, it should be the last time a human tester finds that bug. Automatic tests should check for it from then on.
Write documents as you would write code: honor the DRY principle, use metadata, MVC, automatic generation, and so on.
Documentation created separately from code is less likely to be correct and up to date.
Come to understand your users’ expectations, then deliver just that little bit more.
Craftsmen of an earlier age were proud to sign their work. You should be, too.
Tired of C, C++, and Java? Try CLOS, Dylan, Eiffel, Objective C, Prolog, Smalltalk, or TOM. Each of these languages has different capabilities and a different “flavor.” Try a small project at home using one or more of them.
- What do you want them to learn?
- What is their interest in what you’ve got to say?
- How sophisticated are they?
- How much detail do they want?
- Whom do you want to own the information?
- How can you motivate them to listen to you?
- Design independent, well-defined components. Keep your code decoupled.
- Avoid global data.
- Refactor similar functions.
- New functionality in an existing system
- Structure or contents of external data Third-party tools or components
- Performance issues
- User interface design
- Are responsibilities well defined?
- Are the collaborations well defined?
- Is coupling minimized?
- Can you identify potential duplication?
- Are interface definitions and constraints accept- able?
- Can modules access needed data—when needed?
- Is the problem being reported a direct result of the underlying bug, or merely a symptom?
- Is the bug really in the compiler? Is it in the OS? Or is it in your code?
- If you explained this problem in detail to a coworker, what would you say?
- If the suspect code passes its unit tests, are the tests complete enough? What happens if you run the unit test with this data?
- Do the conditions that caused this bug exist anywhere else in the system?
An object’s method should call only methods belonging to:
- Any parameters passed in
- Objects it creates
- Component objects
- Stay aware of what you’re doing.
- Don’t code blindfolded.
- Proceed from a plan.
- Rely only on reliable things.
- Document your assumptions.
- Test assumptions as well as code.
- Prioritize your effort.
- Don’t be a slave to history.
- You discover a violation of the DRY principle.
- You find things that could be more orthogonal.
- Your knowledge improves.
- The requirements evolve.
- You need to improve performance.
When solving impossible problems, ask yourself:
- Is there an easier way?
- Am I solving the right problem?
- Why is this a problem?
- What makes it hard?
- Do I have to do it this way?
- Does it have to be done at all?
- Unit testing
- Integration testing
- Validation and verification
- Resource exhaustion, errors, and recovery Performance testing
- Usability testing
- Testing the tests themselves