Philosophy of Automation

Philosophy of Automation

  • Comments 13
 In my previous post about Boolean Values And Operators I made the following point: "PowerShell has a rich notion of TRUE/FALSE because it dramatically reduces the overhead and junk that you need to deal with when doing your work."  This philosophy flows from Whitehead's observation:
 
Civilization advances by extending the number of important operations which we can perform without thinking about them.
Alfred North Whitehead, Introduction to Mathematics (1911)
English mathematician & philosopher (1861 - 1947)

Whitehead's point was really driven home to me recently.  Last week we lost power in my area for 6 days.  During this time, we were without the benefits of most of the things I take for granted.  I was struck by how much time it took to do things that previously I had not thought about.  For instance, washing the dishes in the sink and then drying them by hand takes a lot more time then sticking them in the dish washer and hitting the START button.  There were dozens of things that just took a lot more thinking and effort than before (reheating my tea in a pot of hot water vs zapping it in the microwave, getting in and out of my car to open/close the garage door vs clicking a button, etc. etc.).  I didn't terribly mind doing things this way (though I didn't appreciate the cold [it got into the 20s one night]) but the thing I found myself resenting was that I didn't have time to do as much reading as I usually do. 

Whitehead's point is NOT that civilization advances by us becoming non-thinking idiots.  Rather by increasing the number of things that we don't have to think about, we can spend our thinking on NEW things and solving NEW problems and then transforming those things into things that we no longer have to think about.  And so on and so on.  Because I spent time doing dishes means that I didn't have time to read which means that I didn't get more educated which would have made it easier to move the ball forward. 

This is the essense of PowerShell and the heart of automation.  In our world, there is no end of interesting and hard problems to think about and to the degree that our tools continue to make us think about the low level junk is the degree to which we reduce the time that we have to think about those interesting problems.  The ball gets moved forward as we adopt better and better tools that do what we want them to do without us having to tell them and by getting in the habit of automation repeativing operations and sharing that automation with others. 

Huge advances come from the accumulation of small deltas.  In David Copperfield, Charles Dickens wrote, "Annual income twenty pounds, annual expenditure nineteen pounds six, result happiness.  Annual income twenty pounds, annual expenditure twenty ought and size, result misery."  Einstein said it this way, "The most powerful force in the universe is compound interest."   So the next you find youself thinking about how do do something that you've done before, you should take it as an opportunity to invest a little bit and automation the activity so that you don't have to think about it again.  Give the function a good long name so that you can remember it, find it, recognize it when yhou see it and then give it an alias so that you can minimize your typing (e.g. Get-FileVersionInfo and gfvi ). 

Last but not least, SHARE.  Put your script out on a blog or newsgroup or website so that others can benefit from your thinking.  Newton may have figured out gravity but if he didn't share his thoughts with others, he would not have moved the ball forward.  Ok - so your script is not in the same league as "f=ma" but share it anyway because "huge advances come from the accumulation of small deltas" (hmmm, that is the essense of Newton's calculus, seems like I've got a little conceptual fugue going on here :-) ) 

Enjoy!

Jeffrey Snover [MSFT]
Windows PowerShell/MMC Architect
Visit the Windows PowerShell Team blog at:    http://blogs.msdn.com/PowerShell
Visit the Windows PowerShell ScriptCenter at:  http://www.microsoft.com/technet/scriptcenter/hubs/msh.mspx

Leave a Comment
  • Please add 4 and 3 and type the answer here:
  • Post
  • Here is a small script to have a nice prompt.

    When I am in my documents, replace the long prefix c:\Documents and Settings\{User}\My documents to ~, so rather than have half a line prompt, you get some more typing space...

    function global:prompt {

           $location = (get-location)

           $prefix = $home + "\My Documents"

           if($location.ToString().StartsWith($prefix)) {

                   "PS ~" + $location.ToString().Substring($prefix.Length) + "> "

           }

           else {

                   "PS " + $location + "> "

           }

    }

  • Are there any Get-FileVersionInfo functions laying around?

  • > Are there any Get-FileVersionInfo functions laying around?

    Yup - check out:

    http://iirc.spaces.live.com/Blog/cns!CBB573C0CE8DEB37!371.entry

    I left a comment encouraging the use of Fullnames and pithy aliases.  See my comment for there for an example of what I mean.

    Jeffrey Snover [MSFT]

    Windows PowerShell/MMC Architect

    Visit the Windows PowerShell Team blog at:    http://blogs.msdn.com/PowerShell

    Visit the Windows PowerShell ScriptCenter at:  http://www.microsoft.com/technet/scriptcenter/hubs/msh.mspx

  • Sorry to write another rant especially on Christmas, but this has been bothering me for a while.

    Each time these features of subtle nuance are discussed on this blog I feel less and less confident in my knowledge of the language. So much so that I still haven't had a chance to make anything useful in PowerShell.

    I'd rather spend a couple extra seconds thinking than consult the manual each time I'm not sure about some well-meaning but uncertain behavior. That's a lot more "overhead".

    Discovering, learning and/or memorizing which conditions a string will evaluate to true or false is not fun, especially if there is a reasonable risk that we will end up learning the hard way: post mortem.

    Learning and actively recalling these conditions requires more thinking than punching in a few extra keystrokes to disambiguify.

    Coming from a C background, you have to understand that not only do null strings evaluate as false, you also have to realize (usually the hard way unless you've been reading this blog) that empty strings evaluate false as well.

    Coming from a C# or VB background you would have no problem with a little bit of verbosity.

    Coming from Bash you would expect to use the -n operator for this purpose.

    Coming from IT administration with little to no programming knowledge, intuition would probably tell you that, like most of the strict literal behavior of computers in general, it would just throw an error -- strings aren't yes/no's.

    I'm concerned that the textbooks for the language are going to end up being just as thick as the language is rich.

  • I loved this entry because it is a message I have been evangelizing since early in my career.

    Having published several articles - both magazine and online - on Kixtart and other scripting tools - I am convinced that automation and its underutilization across much of IT is a huge missed opportunity for IT professionals to add tremendous value.

    I blogged about your post and my thoughts on scripting and automation here...

    http://blogs.ittoolbox.com/pm/career/archives/why-automation-matters-hint-why-it-matters-too-13634

    In order for IT to provide innovation at the organization (department and user) level, IT Must First Automate IT.

    I'm excited about Powershell because it provides another great tool for doing so.

    Thanks.

    Matt

  • I stole the title of this post from Jeffrey Snover, architect of Windows Powershell. Jeffrey has a post

  • In response to my entry Philosophy of Automation , Tim Long blogged a response where he advanced the

  • I love this idea and have tried to live it myself for many years. It's something I've tried to stress to students and readers. It may not seem like much but even saving a few keystrokes helps. If I can do something with 2 keystrokes I don't have to reach for my mouse or worry about mistyping a long command and having to correct it.

    I blogged recently about an "old-school" automation technique of Doskey. (http://sapien.eponym.com/blog/Scripting/BatchCmd/_archives/2006/12/18/2581354.html)

    I have to say that after starting to use Doskey again, I find myself getting a little more done with a little less energy. Right now there's a trade-off in that I'm spending time adding to my macro file but in the long run I know it will payoff.

  • In my previous blog about the Philosophy of Automation , I encouraged everyone to share their automation

  • $hay has a new scripting blog at http://scriptolog.blogspot.com/ . His first blog entry Restart your

  • Haha, Jeff, so I agree with you 100% on the automation,  and in some ways I've been saying the same thing for years, as I'm sure you have... The only question I have for you is: how'd you score such a nifty post alias like Windows PowerShell?  Can I be Windows UsefulButNotQuitePowerShell?

  • One of the things that motivated us to develop PowerShell was the belief that we (Microsoft) had been

  • Make your SharePoint debugging experience a little less painful

Page 1 of 1 (13 items)