The voting/judging process has started for event 1 in the 2013 Scripting Games. What I’m going to be doing over the next few weeks is point out some of the things that I’ve noticed when judging. Some will be good things that I think you should adopt; others will be bad things that you should avoid. There even may be some interesting stuff to get you thinking.
First off is the use of the backtick as a line continuation:
Get-Process | `
sort Handles –Descending
You don’t need a backtick at this point. The pipe symbol acts as a line continuation marker so the backtick is redundant. All you need to do is this:
sort Handles -Descending
Its the same with commas. You don’t need to do this:
select Name, Id, `
because it works without the backtick
select Name, Id,
You may see backticks used a lot in books but that is an attempt to reduce the width of the code to make it fit the page. We want you to be able to copy the code from the ebook and run it. The alternative is a line continuation marker which you would have to remove.
Bottom line – 99.9% recurring of the time you don’t need backticks as line continuation markers