After the 1st week of the Scripting Games and as we now enter the 2nd week with event 6 today, I figured it was a good time to take a look at some of the things that I have seen during the games. There have been many, many script submitted this year, many more in fact than last year (which is awesome, by the way). Personally I have graded hundreds of scripts and continue to be amazed by all of the great scripts submitted this year. But as always, there are things that could always be improved on or perhaps some accidental mistakes made that could have turned a 3 or 4 star script into a 5 star script.
Now I am not giving out answers here, so look elsewhere . Instead I am just going over some basic things that can help you out not only in the games, but elsewhere for that matter.
These are in no particular order of importance and should all be considered my opinion which does not reflect the other judges and their opinions.
Pay Attention To The Event Design Points
The design points are there for a reason. They are there to help you to help yourself get all 5 stars. If it calls for checking admin rights, then check for admin rights. If it says you can use aliases, then use them. If it says to write out a short novel about your hopes and dreams and then split it into into a hash table through osmosis, well… good luck with that, but still do it! By not following these design points, you are setting yourself up for heartbreak of not receiving all of the stars that you were hoping to achieve.
Don’t Forget About The Event Guidelines
On the other side of the coin, do not forget what you are supposed to be coding here. While design points will help you in your quest for a 5 star script, it will possibly crumble around you if you do not meet the actual goal of the script.
Less Can Sometimes Be More
Remember, writing a complex 500 line script that can get you the current date and time in 5 days is not always the best method to solve a problem. Unless you feel that you need to write more lines than necessary to solve a problem (and it really needs to be a good reason), you should try to make it with the least complexity as possible (have good comments if you can’t) and keep it as short as possible. This doesn’t mean skimp out on things, just use your best judgment to get the job done.
Slower Is Faster
Remember, you have 1 week from the time an event goes live to get it done and submitted. This is plenty of time to write the script and get it submitted prior to the deadline. It is better to turn it in later in the week and know it works the way it is supposed to then to submit it the same day it goes live and only get a couple of stars due to some mistakes. Your script will get rated regardless of when you submit it, so you have nothing to worry about.
The moment the event goes live, you have the opportunity to ask questions on the Event article on Hey, Scripting Guy!. Not quite sure what it might be you are looking for, just ask! While the answers will not be given to you, Ed can provide some clarification to the event in the case that something just doesn’t make sense. Another reason to not be that first person to submit a script for the event after it goes live.
Research, Research, Research!
Look at previous Hey, Scripting Guy! articles. For that matter, look online for other articles that might relate to the event you are trying to solve. I can say that one of my own functions that I uploaded to the Script Repository made a big jump in activity since the games started up. You are not being help in a closed, locked room with only a laptop and an open connection to the poshcode site. So take advantage of what you have available to better align yourself with the correct method to solve each event.
Test Your Code!
This should go without saying. Make sure your code works before submitting. Try it out in various circumstances to make sure you cover all of the angles. Doing so will (hopefully) ensure that the code does not fail by the time we look at it, causing it to become a 1 star script. I have to admit that I have had the unfortunate task of giving a 5 star script only 1 star because it fails to run for me. Sad, but true. So take the extra time to test it out before submitting so you have one less thing to worry about.
Once the games close out, I will post some more things that I have seen, but am avoiding talking about until after the last event closes as I don’t want to give an unfair advantage to those folks who have yet to submit a script in various events. Just remember, this is not only a competition, but also a great learning opportunity as well as a fun time to see how you do with other awesome PowerShellers!
Good luck in your second week of the Scripting Games!