The Pragmatic Craftsman :: Simplicity from complexity : by Stanley Kubasek ::

A Pragmatic Quick Reference

You’ve probably heard about the Pragmatic Programmers — Hunt and Thomas — and their famous book: The Pragmatic Programmer: From Journeyman to Master (I’m currently reading it). I really recommend this book — I’ll do a formal review later, after finishing it. Anyway, in that book, they have quite a few really good — pragmatic — tips. I thought it would be nice to have those tips summarized. Sure enough, I found a summary today on CodingHorror.com. You will appreciate this reference more after you read the book.

The Pragmatic Programmer Quick Reference Guide

This page summarizes the tips and checklists found in The Pragmatic Programmer.

For more information about The Pragmatic Programmers LLC, sourcecode for the examples, up-to-date pointers to Web resources, and anonline bibiography, to to www.pragmaticprogrammer.com

  1. Care About Your Craft
    Why spend your life developing software unless you care about doing it well?
  2. Think! About Your Work
    Turn off the autopilot and take control. Constantly critique and appraise your work.
  3. Provide Options, Don’t Make Lame Excuses
    Instead of excuses, provide options. Don’t say it can’t be done; explain what can be done.
  4. Don’t Live with Broken Windows
    Fix bad designs, wrong decisions, and poor code when you see them.
  5. Be a Catalyst for Change
    You can’t force change on people. Instead, show them how the future might be and help them participate in creating it.
  6. Remember the Big Picture
    Don’t get so engrossed in the details that you forget to check what’s happening around you.
  7. Make Quality a Requirements Issue
    Involve your users in determining the project’s real quality requirements.
  8. Invest Regularly in Your Knowledge Portfolio
    Make learning a habit.
  9. Critically Analyze What You Read and Hear
    Don’t be swayed by vendors, media hype, or dogma. Analyze information in terms of you and your project.
  10. It’s Both What You Say and the Way You Say It
    There’s no point in having great ideas if you don’t communicate them effectively.
  11. DRY–Don’t Repeat Yourself
    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
  12. Make It Easy to Reuse
    If it’s easy to reuse, people will. Create an environment that supports reuse.
  13. Eliminate Effects Between Unrelated Things
    Design components that are self-contained. independent, and have a single, well-defined purpose.
  14. There Are No Final Decisions
    No decision is cast in stone. Instead, consider each as being written in the sand at the beach, and plan for change.
  15. Use Tracer Bullets to Find the Target
    Tracer bullets let you home in on your target by trying things and seeing how close they land.
  16. Prototype to Learn
    Prototyping is a learning experience. Its value lies not in the code you produce, but in the lessons you learn.
  17. Program Close to the Problem Domain
    Design and code in your user’s language.
  18. Estimate to Avoid Surprises
    Estimate before you start. You’ll spot potential problems up front.
  19. Iterate the Schedule with the Code
    Use experience you gain as you implement to refine the project time scales.
  20. Keep Knowledge in Plain Text
    Plain text won’t become obsolete. It helps leverage your work and simplifies debugging and testing.
  21. Use the Power of Command Shells
    Use the shell when graphical user interfaces don’t cut it.
  22. Use a Single Editor Well
    The editor should be an extension of your hand; make sure your editor is configurable, extensible, and programmable.
  23. Always Use Source Code Control
    Source code control is a time machine for your work—you can go back.
  24. Fix the Problem, Not the Blame
    It doesn’t really matter whether the bug is your fault or someoneelse’s—it is still your problem, and it still needs to be fixed.
  25. Don’t Panic When Debugging
    Take a deep breath and THINK! about what could be causing the bug.
  26. “select” Isn’t Broken.
    It is rare to find a bug in the OS or the compiler, or even a third-party product or library. The bug ismost likely in the application.
  27. Don’t Assume It—Prove It
    Prove your assumptions in the actual environment– with real data and boundary conditions.
  28. Learn a Text Manipulation Language.
    You spend a large part of each day working with text. Why not have the computer do some of it for you?
  29. Write Code That Writes Code
    Code generators increase your productivity and help avoid duplication.
  30. You Can’t Write Perfect Software
    Software can’t be perfect. Protect your code and users from the inevitable errors.
  31. Design with Contracts
    Use contracts to document and verify that code does no more and no less than it claims to do.
  32. Crash Early
    A dead program normally does a lot less damage than a crippled one.
  33. Use Assertions to Prevent the Impossible
    Assertions validate your assumptions. Use them to protect your code from an uncertain world.
  34. Use Exceptions for Exceptional Problems
    Exceptionscan suffer from all the readability and maintainability problems ofclassic spaghetti code. Reserve exceptions for exceptional things.
  35. Finish What You Start
    Where possible, the routine or object that allocates a resource should be responsible for deallocating it.
  36. Minimize Coupling Between Modules
    Avoid coupling by writing “shy” code and applying the Law of Demeter.
  37. Configure, Don’t Integrate
    Implement technology choices for an application as configuration options, not through integration or engineering.
  38. Put Abstractions in Code, Details in Metadata
    Program for the general case, and put the specifics outside the compiled code base.
  39. Analyze Workflow to Improve Concurrency
    Exploit concurrency in your user’s workflow.
  40. Design Using Services
    Design in terms of services—independent, concurrent objects behind well-defined, consistent interfaces.
  41. Always Design for Concurrency
    Allow for concurrency, and you’ll design cleaner interfaces with fewer assumptions.
  42. Separate Views from Models
    Gain flexibility at low cost by designing your application in terms of models and views.
  43. Use Blackboards to Coordinate Workflow
    Use blackboards to coordinate disparate facts and agents, while maintaining independence and isolation among participants.
  44. 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.
  45. Estimate the Order of Your Algorithms
    Get a feel for how long things are likely to take before you write code.
  46. Test Your Estimates
    Mathematical analysis of algorithms doesn’t tell you everything. Try timing your code in its target environment.
  47. Refactor Early, Refactor Often
    Just as you mightweed and rearrange a garden, rewrite, rework, and re-architect codewhen it needs it. Fix the root of the problem.
  48. Design to Test
    Start thinking about testing before you write a line of code.
  49. Test Your Software, or Your Users Will
    Test ruthlessly. Don’t make your users find bugs for you.
  50. Don’t Use Wizard Code You Don’t Understand
    Wizards can generate reams of code. Make sure you understand all of it before you incorporate it into your project.
  51. Don’t Gather Requirements–Dig for Them
    Requirements rarely lie on the s
    urface. They’re buried deep beneath layers of assumptions, misconceptions, and politics.
  52. Workwith a User to Think Like a User
    It’s the best way to gain insight into how the system will really be used.
  53. Abstractions Live Longer than Details
    Invest in theabstraction, not the implementation. Abstractions can survive thebarrage of changes from different implementations and new technologies.
  54. Use a Project Glossary
    Create and maintain a single source of all the specific terms and vocabulary for a project.
  55. Don’t Think Outside the Box–Find the Box
    When faced with an impossible problem, identify the real constraints. Ask yourself: “Does it have tobe done this way? Does it have to be done at all?”
  56. Start When You’re Ready.
    You’ve been building experience all your life. Don’t ignore niggling doubts.
  57. Some Things Are Better Done than Described
    Don’t fall into the specification spiral—at some point you need to start coding.
  58. Don’t Be a Slave to Formal Methods.
    Don’t blindly adopt any technique without putting it into the context of your development practices and capabilities.
  59. Costly Tools Don’t Produce Better Designs
    Beware of vendor hype, industry dogma, and the aura of the price tag. Judge tools on their merits.
  60. Organize Teams Around Functionality
    Don’t separate designers from coders, testers from data modelers. Build teams the way you build code.
  61. Don’t Use Manual Procedures
    A shell script or batch file will execute the same instructions, in the same order, time after time.
  62. Test Early. Test Often. Test Automatically
    Tests that run with every build are much more effective than test plans that sit on a shelf.
  63. Coding Ain’t Done ‘Til All the Tests Run
    ‘Nuff said.
  64. Use Saboteurs to Test Your Testing
    Introduce bugs on purpose in a separate copy of the source to verify that testing will catch them.
  65. Test State Coverage, Not Code Coverage
    Identify and test significant program states. Just testing lines of code isn’t enough.
  66. Find Bugs Once
    Once a human tester finds a bug, itshould be the last time a human tester finds that bug. Automatic testsshould check for it from then on.
  67. English is Just a Programming Language
    Write documents as you would write code: honor the DRY principle, use metadata, MVC, automatic generation, and so on.
  68. Build Documentation In, Don’t Bolt It On
    Documentation created separately from code is less likely to be correct and up to date.
  69. Gently Exceed Your Users’ Expectations
    Come to understand your users’ expectations, then deliver just that little bit more.
  70. Sign Your Work
    Craftsmen of an earlier age were proud to sign their work. You should be, too.

Your Code Sucks

Most likely, it does. Here is an article, Why Your Code Sucks by Dave Astels that will tell you why it does. Read the article as I think it’s great. After you read it, make sure you verify your code according to all of the points. Dave says that your code sucks if it meets the following criteria:

1. Your code sucks if it doesn’t work.2. Your code sucks if it isn’t testable.3. Your code sucks if it’s hard to read.4. Your code sucks if it’s not understandable.5. Your code sucks if it dogmatically conforms to a trendy framework at the cost of following good design/implementation practices.6. Your code sucks if it has duplication.

So, I ask you, does your code suck?

I think some of the code that I write sucks because it isn’t very easily testable. I think, though, that it is hard to test web applications and that’s the main reason behind it. I’m trying to find an easy way to do that so I can eliminate it. I agree with the author, your code should be easily testable. As far as the other points are concerned, I would say that my code is easy to read, easy to understand, and it does not have any duplication. I take extra care in those areas.

Software Bookshelf

Are you looking to test me? Or maybe you just want to see how I stuck up against other IT guys? OK. OK. What I’m trying to say, is that it is always good to get a second opinion. So, I’m going to give you that second opinion (or more than one).

Here are a couple of links to pretty good Software Bookshelves from established software gurus. These lists “guide” me to what my next reading should be. I always like books recommended by others. It gives me a bigger determination to read it.

The best

Joel on Software: Book Reviews

Steve McConnell (my favorite author): Recommended Reading List

windchill23 (20+ Years Programming): MasterSoftwareDeveloper

Worth a look

Otaku Cedric (accomplished developer): books read

Arno Hutter (don’t know much about him): Software Bookshelf

Tom Van Vleck: Software Engineering Reading List

I really like McConnell’s lists as well as Joel’s list. Almost all of the books listed there are on my must-read books. Those are classics, basically. Tom Van Vleck’s list is good also. I like first couple, five I think, books from the Software Bookshelf.

There you go, now you can have few other sources. Plus, you might get a glimpse of things to see in my future reading.

The Rational Edge

Donald Bell, Philippe Kruchten, Gary Evans? Ring a bell? If not, they are all influential IT minds. And they all write articles that are published in The Rational Edge.

I have to say that The Rational Edge e-zine is probably the best newsletter that I subscribe to. The quality of the articles is great. Even though it mostly concentrates on the Rational Unified Process, it touches several others, like UML, book reviews, and other valuable information for a software engineer. (I do think however, that the Rational Unified Process (RUP) is the best software-engineering process.)

The archive section on the site is substantial, too. It offers articles that were written in the previous versions of The Rational Edge. I check back here often.

All in all, IBM is doing a good job in enticing software engineers. I highly recommend subscribing to the e-zine and looking through the archive, and/or searching for an article (using the search tool).

Outsourcing or Innovation

Yes, you cannot have both. It’s just not possible. That’s the stand of Johanna Rothman. She has some very interesting points.

“If you choose innovation, you can’t outsource,” she says. “You can’t define all the requirements and hand them off to anyone in a highly innovative product — requirements definition and product development have to be a joint exploration — and you can’t do that when the definers and the developers (and testers) don’t sit near each other. You can’t wait for a product to be done — you need to see the product unfold and adjust the product (or the project) to accommodate the things you forgot.”

It’s a different angle on outsourcing, but I think a valid one. You don’t get innovation from outsourcing. You get what you ask for. And that’s not always the case.

Read this short, but informative blog entry.

IT Job Outlook

Adding Value…Growing CareersThe Employment Outlook in Today’s Increasingly Competitive IT Job

That’s the title of the study published by Information Technology Association of America. This is one of the best I’ve read. A little long, but the content is great.

Topics covered in the survey are:• Size of the IT workforce• Demand for IT workers• Best background for IT employment• Soft skills and other factors• Employee retention• Future sources of job

Here is a short excerpt:

Bottom line? Competitive pressure is an issue for employees and employers alike. To be successful IT workers must make themselves as valuable as possible to hiring companies. They must also make themselves the stewards of their own careers. Understanding the trends and directions shaping the IT workforce is one of the best ways to launch or sustain an information technology career.

http://www.itaa.org/workforce/studies/04wfstudy.pdf

Martin Fowler's Bliki

Martin Fowler, to me, is a great IT mind. He has written three (that I know of) books that are on my must-read list. I I own the first two. All three are pretty much classics in the industry. They are: Refactoring, UML Distilled, and Patterns of Enterprise Architecture.

Fowler has also written countless articles on design (Is Design Dead? is my favorite) and architecture (mainly in IEEE Software magazine, where he is still the editor of Design).

Needless to say, Martin Fowler is an industry leader, great writer. He’s somebody that you should know about as a software engineer. (And read his books, too.)

That’s enough about him, the person, since this post is about his blog, Martin Fowler’s Bliki. I’ve been reading it for couple of months now. I think it’s pretty good. I’ve been enjoying it. It’s a bit on a technical side (he is an architect after all) but he touches several areas, mainly design, architecture, refactoring, uml, agile-development, and others. Add it to your RSS Reader (I use Bloglines) and enjoy it too.

How To Survive The Coming Bust

I came across an interesting article, How To Survive The Coming Bust, recently — little dated, but still valuable. The author argues that you need to do the following six things to survive.

1) Provide Guarantees2) Analyze the business and provide a better solution3) Dramatically decrease the defect rate4) Create well-documented, maintainable code5) Provide better feedback6) Show the customer how you will make them money or allow them to cut costs

I think most of them hold true and I do think that we — software engineers — have a bright future indeed. Under one condition, though: we have to be better than our competition. We have to be better than those developers in other countries. We have to be the best. (I’ll create a post about how to thrive in a global IT market later.) It is possible, it just requires more work.

A Professional

A professional is a person who can do his best ata time when he doesn’t particularly feel like it.

Alistair Cooke

Why Java is Cool

I come across a very interesting post today: a post that explains why Java is cool. I think the poster has some very good points about Java and I agree with him. Yeah, Java is cool and hopefully it will be cool for a long time. I’m excited about Java 1.5: it has some very nice features that will make Java more useful and easier. So why is Java cool? Here are the top-level reasons from the post (make sure you read his explanation on each one):

1. Java has considerably fewer surprises2. Java is not slow3. Swing is improving a lot4. Java’s libraries…5. Java has lots of good (free) IDEs6. Java is a programming platform

“So basically Java is cool because Java is for everybody. Not just a geek-only thing.”

Favorite Quote

Topics

Tags

Archive

Currently Reading

Info

© 2001-2025 Stanley Kubasek About me :: Contact me

Me on Twitter

»see more

Recent Entries