This post talks about an old, dead project, SprayFire; you can read about it's demise. All links pointing to the project have been removed.

When I worked with the Monks of New Skete I got a first-hand opportunity to learn about dog training from world-reknowned dog trainers. I thoroughly enjoyed the chance to learn more about communicating with our canine friends and have taken on dog training as a more serious hobby. It has been a wonderful experience being able to truly connect with a dog, who really just wants to play and have a good time. But, dog training is serious fun business. It isn’t just obedience commands, no more than programming is just writing code. I believe that it is composed of the communication, discipline, love and respect between canine and man in its entirety. How you go about living your life with your dog is dog training; obedience is simply one aspect of that life style.

I believe that dogs can teach us a lot about ourselves and that dog training principles can be applied in a variety of situations, including programming. Dog training is not a skill naturally gifted, it is one that is learned and practiced. You either commit yourself to learning and studying the appropriate ways to communicate with a dog or you don’t. You either commit yourself to learning and studying the appropriate ways to program or you don’t. But, how can dog training apply to writing computer software?

consistency

Mercedes, a New Skete German Shepherd Consistency is one of the most important aspects of dog training, particularly obedience training. Understanding how canines communicate to get the best results you must be consistent with your communication. If you consistently tell your dog to “sit” three times before they sit and you then reward your dog you will soon discover that you must tell your dog to sit three times every single time. Why? Because that’s what you taught your dog to do!

I believe that to make a maintainable program one must be consistent with your coding style, documentation, and the overall readability. Consistent code is, eventually, easier to read. Easier to read code is easier to maintain code and that’s the whole point of higher-level languages. To make it easier to read and understand code. If you’ve ever tried to read a body of work that had inconsistent formatting you know full well how important this is.

patience

Patience is the most important thing in dog training. If you are not patient with the dog and fly-off the handle at the slightest provocation you are gonna suck at dog training. Dogs are often singular in their mindset and, for example, may decide that you should know about something and they’re gonna bark until they’re sure you know. This can be a frustrating habit to train out of a dog; first you must have the patience to understand what and why the dog is trying to communicate to you. Then you must have the patience to actually carry through with your training plan. These are very trying tasks, particularly when so much of what you do is crucial to get the results that you want; your body language, the tone of your voice, and the loudness of your voice are just some of the very crucial aspects of communicating with a dog.

If you don’t understand how patience is important to programming then for goodness sakes close this browser right now and go code something! I was going back through SprayFire unit tests and doing some refactoring. Instead of just assuring that the expected error occurred I decided to also check that the expected error message occurred. I soon discovered a flaw in an algorithm; it still produced passing unit test results but was following the wrong path of execution. I fixed the flaw and now the code is a little bit better. The patience to write those unit tests, instead of just being happy with what I had, and the patience to go fix the flaw is what made the code better.

technique

Technique is critically important to proper dog training. And there can be a lot of different, valid, techniques to achieve the appropriate results with your pooch. Not all techniques are good ones though and some techniques in the wrong hands can be deadly. Proper technique can be the difference in feeling like you must “fight” with the dog the entire time and the dog wanting to obey.

Mercedes, a New Skete German Shepherd

In the programming world this would be design patterns. That’s really all design patterns are, a technique to solve a problem. Proper use of the technique makes the code simple and it obeys your every whim. Misuse of the technique and your code is rendered a useless, cruddy mess. Not all techniques are appropriate for a given situation and much of becoming a master of your craft is determining what techniques should be applied when.

wrapping it up

This post didn’t really start out with a purpose; I just wanted to talk about dogs and put some pictures of Mercedes up. I guess I’ll leave you with the thought that the best kind of learning is when you can apply it to more than just the situation at hand and really change the way you do things.