A couple years ago, my wife and I decided it was time to expand our household and get a couple of rascals. Our first adoptee was Linus. Prior to this adoption, wife and I knew that we were going to begin this quest. Being a good dog-dad meant I had to train myself on how to be a good and responsible dog parent. I looked no further than the Internet (I bought a book too).
When we found Linus, he was one scared little pupper. In some misguided Microsoft love, I initially named him DirSync. My wife contends that It was my intent to keep that name but really I was trying to get her to commit to a better name.
Upon adopting our first pup, Linus, I started training immediately. I was working at Coca Cola at the time, and I planned it so that I could take paw-ternity leave, meaning I took two weeks off work so that I could properly onboard the new member of our family (not something Coke offers, I used PTO). Then the training began. I employed the methods from Zak George’s Training Revolution. This method utilizes the idea that you can not only train your dog to do anything, but you can establish strong communication and an enduring relationship built on trust with your canine using positive reinforcement and repetition. The key to this method is manage expectations and understand that it’s all about micro-successes (Sound familiar?); which eventually can turn into breakthroughs, or as I refer to them: macro-successes. During our training sessions, I would use very small treats (low caloric) to coerce him into the position of the trick that I want. In some cases, I would also use toys to entice Linus with Play. I learned very quickly that Linus was more play motivated than treats.
During our two week onboarding, I focused on ensuring Linus understood two major things:
Dad is the boss Business is done outside
Dad is the Boss:
This training was primarily done with Linus in the house (in our kitchen) on the leash, under constant supervision.
Business Outside:
This training consisted of ensuring there were no smells for Linus to be attracted to mark in the house and taking him on LOTS of walks. We went on probably 7 walks a day. I live near a forest preserve with 3-4 miles of hiking trails so this was pretty easy to do with no work going on. Eventually I got Linus to learn how to poop on cmd Numero Dos
I started by training Linus how to sit
with a series of micro-successes
Then we got Shake
Then lay down
Then I got him to play dead
, sort of.
Eventually we got play dead
and roll over
in one session (macro success).
So what does this have to do with Code?
During this time in my life, I was often heads down in PowerShell. I wasn’t quite scripting yet, but I knew that is where I wanted to be. I spent most of my time debugging and trying to understand code that others had written. Coca Cola had a lot of custom scripts they utilized to automate processes needed for Exchange, Skype, and SharePoint due to the extreme complexity of their Active Directory forests
As a budding PowerShell Script novice, I was just starting to scratch the surface on concepts such as loops and functions. Then when training Linus, it clicked. Teaching dogs is a lot like teaching computers! Both need to be taught their instructions in very small bites, building upon prior instructions. Also in order to teach yourself, or the computer something, you cannot start without the needful. Some purpose for this code you are authoring. In the case of the dog, If I wanted him to roll over, I have to start with sit, then lay down, then somehow get him on his back, then I need to get him to keep rolling f
rom play dead. You cant just tell a dog to roll over, and expect them to understand your expectation of what ‘roll over’ means, just as you expect tell a computer to understand your intent with a piece of information without establishing said information what kind of value that information is, and then you have to manipulate
that information to meet your need.
The real question to be answered who trained who?
One of the hardest things to teach Linus:speak
One of the hardest things I learned to do in PowerShell: Using the Exchange EWS API
Ultimately, now Linus knows a lot of things, not just tricks, but rules of our house. Here is a list of things Linus knows:
He knows how to Taylor Swift
which means to Shake it off
(shake all the grass and dirt off himself before coming into the house). Here is a running list of Linus functions:
Sit Lay Down Cha Cha (a dance) Salsa (another dance) Speak (bark) Sing (whine his voice) Taylor Swift / Shake it off Play Dead Roll Over Numero Dos Fetch Drop it / Leave it Yes No Outside / Walk Treat Stay
Wesley also has a myriad of functions that overlap Linus’s, including some that are not cmd based, for instance he is trained to be very protective of Madiha, to the point where he is not amused when I kiss her!
Here is Wes doing the Cha Cha! (Wir Tanzen im fur Eck)