There’s been a lot of dismay floating around the community about the state of “community voting” in the Scripting Games. Some folks are voting without leaving comments (we’ve expanded the comment field to 2000 characters, hopefully that’ll help), and some disagreement about scores.
Disagreement is natural. For example, stick a Write-Host in your script and I’m likely to score you lower. You may disagree, but it’s how I feel in many situations… and I’m seeing a distressing amount of it.
Did you know that using [CmdletBinding(SupportsShouldProcess=$True)] doesn’t automatically and universally make the -confirm switch work? You have to do a bit more.
Did you know that if you put $DebugPreference=‘SilentlyContinue’ in your BEGIN{} block, that you disable the built in -Debug switch’s functionality? Yep, seen this one a few times also.
The community is showing a distinct lack of love for scripts that look like VBScript scripts. Does that mean your script is wrong? No - but it means you’re not approaching the problem in a way that the world in general feels is best. It doesn’t mean your script won’t work - but it means it wouldn’t be widely accepted.
If you’re not happy with your score, look at some higher-scoring scripts. See what they’re doing differently. If you can’t figure it out, post in the forums on PowerShell.org (there’s a Scripting Games forum). Provide the permalink to your script, and solicit some feedback from the community. Tweet people and ask them to take a look. You can ask for more feedback, if you want it and aren’t getting enough.
As our judges begin to post their notes, look at what they’re writing. Maybe they didn’t pick your script to write about - but are they writing about things that you also did in your script?
I’m seeing a lot of good scripts. But I’m also seeing some misunderstandings of some core, advanced features, like error handling, use of Verbose output, and so on. Each of those is a star to a half-star off, for me… some of these things, in my opinion, are severe, and I score accordingly. I haven’t seen a perfect, un-improve-able script, yet (I’m not even halfway through, yet). So no 5-stars yet. But I am trying to leave comments, and I know others are, too, so hopefully folks can improve. But be patient - it takes time.
And opinions differ. Let me offer an example:
Write-Verbose (“Script: {0} ended at {1}” -f $MyInvocation.ScriptName, (get-date) )
****Dislike. Not saying it’s wrong at all - and some people will disagree, vehemently, with me. But I find -f strings hard to read.
Write-Verbose “Script $($MyInvocation.ScriptName) ended at $(Get-Date)”
****For me, that’s easier to read. Not any more “right,” but in my company that’s the standard we adopted and that we use. Now, hopefully my opinion is being balanced by others’ opinions. But, if a substantial number of people share my opinion, this code would get a low score, and a community standard practice would emerge - something we can learn from after the Games are complete. Because yes, I’m going to harvest the Games entries and comments long after the Games are over to help keep the conversation and education going.
My point of this is that none of us are as awesome as we think. Others will always have points of disagreement. What’s really exciting here is the opportunity to create a community consensus of what’s best. That won’t come for several weeks, yet… but it will come. There is zero immediate benefit in getting a high score in the Games, and zero immediate detriment to a low score. This is going to seem harsh, but the Games are not about you. They’re about all of us. They’re about us developing a sense of community involvement and standards in an industry that doesn’t supply many of its own. This will happen over time, and with a lot of effort. But it’s worth it.
Let’s continue.
[ValidateScript({(Test-Path $_ -PathType Container)})]
I love that. I never thought to do that, and I love it. I’ve seen a few people do it. Bless them. I learned something!
An aside: There’s this general undercurrent of, “I wish ’expert’ judges were scoring me instead of the great unwashed masses.” Let me point out some practical realities. One, every entry in the Games at this point has at least 4 votes; many have double that. The last event, most had 1, 2 at most. And yes, while ’expert’ judges are allegedly well-qualified to render judgment, I’m not seeing a ton of scores I completely disagree with, yet. A few. Not a ton. And you want to know a dirty secret? How many entries do you think an ’expert’ can look at, in the evening, after working all day (we’re all volunteers), before he just starts getting a little arbitrary and inconsistent? The number is not “infinite.” I know I got a little arbitrary last year before I caught myself and stopped for the night. So… don’t discount the value of your peers’ opinions. If you’re getting a low score and don’t know why, seek out answers. Yes, people should leave comments with their votes. If they don’t, take charge and seek out answers yourself.
I love that I’m seeing so many divergent approaches to a single (admittedly open-ended) problem. Frankly, the value here is in browsing others’ approaches and picking up some tips from them. Or just seeing something different. You shouldn’t care about your score. You should care about what other people are doing, and about why you think their way might be better, worse, or just different. Make a learning opportunity. Don’t wait for someone to come to you with a free, written analysis of your code. Analyze other people’s entries and judge yourself against their work.
I’ve seen this a few times: