Best Practices Update and some Scripting Games thoughts

Just a quick note to let you know that I haven’t given up on writing about PowerShell best practices. A few things which have derailed my thinking.

  • My first “best practice” I thought was a no-brainer. After I wrote it I got thinking about what actual benefit there was to sticking to single-quotes rather than using double-quotes. Perhaps it makes sense to use double quotes all the time unless you don’t want interpolation and control characters.
  • The 2013 Scripting Games started. Reading the comments by the community regarding the scripts has been a real eye-opener about how people feel about different topics. I think I’ll probably wait until the games are over and try to compile a list of what everyone seems to agree on.

With regard to the Scripting Games, if you haven’t gotten involved with them it’s not too late. There are still 2 events left (I think). Even if you don’t feel up to competing, looking at over a hundred different implementations of the same problem will definitely get your brain working on some new stuff to try in your scripts. Maybe some technique you hadn’t really used before (splatting? parameter validation? pipeline input? comment-based help?). Take some time to read through some of the entries and at the very least you’ll start to develop an opinion on what “good” means in a script. If you do enter, don’t worry too much about the judging. The point values have been “evolving” over time and the important thing (to me) is the constructive comments I’ve received on my scripts. Some of the comments haven’t been accurate (or helpful), but hey, you get what you pay for.

My hat is definitely off to Don Jones and the rest of the PowerShell.org folks for hosting this. If you’ve been watching the forums at all, you can tell that they’re working hard to make it successful. If you’ve looked at scripts, you know that they’ve added a lot of awesome functionality on the judging side for how the commenting and scoring is handled.

Looking forward to event 5.

Mike