DEV Community

Cover image for 100 Tips from The Pragmatic Programmers Book: Part 7/10
Rajesh Royal
Rajesh Royal

Posted on

100 Tips from The Pragmatic Programmers Book: Part 7/10

7.1. Listen to Your Inner Lizard.

When it feels like your code is pushing back, it’s really your subconscious trying to tell you something’s wrong.

 

7.2. Don’t Program by Coincidence.

Rely only on reliable things. Beware of accidental complexity, and don’t confuse a happy coincidence with a purposeful plan.

 

7.3. Estimate the Order of Your Algorithms.

Get a feel for how long things are likely to take before you write code.

 

7.4. Test Your Estimates.

Mathematical analysis of algorithms doesn’t tell you everything. Try timing your code in its target environment.

 

7.5. Refactor Early, Refactor Often.

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.

 

7.6. Testing Is Not About Finding Bugs.

A test is a perspective into your code, and gives you feedback about its design, api, and coupling.

 

7.7. A Test Is the First User of Your Code.

Use its feedback to guide what you do.

 

7.8. Build End-To-End, Not Top-Down or Bottom Up.

Build small pieces of end-to-end functionality, learning about the problem as you go.

 

7.9. Design to Test.

Start thinking about testing before you write a line of code.

 

7.10. Test Your Software, or Your Users Will.

Test ruthlessly. Don’t make your users find bugs for you.

 
Thanks for reading, happy coding 😀

Top comments (0)