Wednesday, June 30, 2010

Government and the DRY Principle

I recently read a book called The Pragmatic Programmer, by Andrew Hunt and David Thomas. One of the things they repeatedly stress is the DRY Principle. Don't Repeat Yourself.

Any good programmer practices this rule, to a limited extent. Calling a function instead of rewriting the same block of code  over and over again follows the DRY Principle. But Hunt and Thomas suggest taking it even further, further than I would have thought practical.

Most people take DRY to mean you shouldn't duplicate code. That's not its intention. The idea behind DRY is far grander than that.

DRY says that every piece of system knowledge should have one authoritative, unambiguous representation. Every piece of knowledge in the development of something should have a single representation. A system's knowledge is far broader than just its code. It refers to database schemas, test plans, the build system, even documentation.

-Dave Thomas
They say to do that by using code generators, automated scripts and other such tools.

But I think this principle can be good outside of computer contexts. I think that it could be applied to the government, at least in some situations, to make it more efficient.

What brings this to mind is changing my address. You shouldn't have to change your address twice (once for the Post Office, once for the BMV). You should be able to change your address once, in one place and have that communicated to other relevant agencies. This would make the system somewhat more complex, but also more efficient and more consistent.

I'm sure there are other bureaucracies and other real life situations this would apply to.

1 comment:

  1. I think that is the whole problem with bureaucracy is the inefficiency and impracticality. They get disorganized from the ideal "dry" state that you described.

    ReplyDelete