04 August 2011

IF(CHECK == RUN_DATE)

I have been writing a lot of scripts for Google Docs at work lately, mostly because I have finally learned how to do more advanced scripting than I had done previously. The Admin office had requested a script that ran once a month, towards the end of the month, to notify them of the upcoming birthdays and insurance eligibility. The script itself was very similar to one I wrote for the Customer Service office so this one was not too hard. The bigger challenge, oddly enough, was not the script but the timer. They only wanted it ran once a month but Google only has built in timers for Minute, Hour, Day and Week. I wrote the script and puzzled over how I was going to get it  to run monthly. Then it struck me: No one cared how often the script ran as long as it only sent out emails once a month. With this in mind the solution was simple: IF(CHECK_DATE == RUN_DATE)--in other words: if today's date happens to be the 26th then run the script. I set the script to run daily and now it runs for a second to compare dates and 29 days a month (actually, 30 some months and 27 or 28 for one month depending on the year) the script does nothing. But on that one special day it works its magic.

Where was I going with this? Oh, I remember. Sometimes I get so focused on the vision of how I think things should work that I forget that the how (in most cases) is far less important than the accomplished end goal. In Malcolm Gladwell's Blink he talks about how the military used to write incredibly articulated orders that were intended to cover every action to be taken by the soldiers. They found that these orders were nearly useless once the fighting started. The military phased out these verbose orders and replaced them with what they call the "Command Intent" (CI). The CI tells every level of the command structure, in short concise language, the single most important goal. Note that the CI is ONE goal, not several goals. This is because as soon as you start interlacing various objectives you water down the entire purpose of the CI: your soldiers no longer have a singular focus. Coupled with the CI there may be additional orders that clarify and flesh out the CI with additional goals and preferred outcomes but the CI removes all ambiguity as to what success looks like. Something like:
Command Intent: Build a bridge to move tanks across the river.
Additional Information: We would prefer that the bridge be a far north as possible and in a location that will allow for quick access to roads on both the east and the west sides while providing a strong defense position.
Note how the preferences do not cloud the CI (by the way, I made up those commands just as an example, Gladwell includes better examples in his book). The CI tells us that the commanders will be happy if there is a bridge that support tanks. They would be elated if the other conditions were also met, but they will be happy with the bridge. The magic of this type of ordering is that the soldiers who are actually running the bridging equipment and playing in the forests with the enemy can work out where the most effective position will be instead of a commander in a distant office. In the end, the commander really does not care where the bridge is as long as he can get his tanks across. Another advantage is that everyone knows what the overall objective is and if the see one group struggling, they can quickly step in and assist. Before it was "our orders are to stay here and guard nothingness" and now it is "we need to get the bridge built, what can we do to help". This creates a more efficient use of resources, one that can quickly adapt to environmental changes (like ants in an ant nest as in
Quorum Sensing (or Natural Leadership Vetting).

In the context of this script, I was too focused on the mechanics of running a script monthly instead of the Command Intent of monthly emails. After realizing that the intent was to get monthly emails and that it did not matter how often the script ran, the needed course of action seemed obvious.

Sometimes express direction is needed, and indeed critical, but I am finding it more often that such directions only cloud the judgement and creativity of the individuals by forcing them to do it my way instead of allowing them to learn and grow by doing it there way.

No comments:

Post a Comment