Why Semi-Colons?

Sorry, no code here.  Just a quick thought.

Q: Why should I put semi-colons at the end of lines?  PowerShell is smart enough to parse EOL as command terminators.

A: Because some blogs are stupid and strip linefeeds.  That means you get a single line of PowerShell code when you copy-paste something that onscreen is a nicely formatted function.  If I spray my code with semi-colons, there's at least a chance that someone copying-pasting it into their ISE has something usable.

While this blog doesn't do that, other blogs do.  It's a good habit to get into, in case I should move to another blog, and it's also a favour to the community at large - while I don't condone it, I would expect some of my posts to be copied-pasted into other blogs, running under other software, some of which may strip linefeeds.

Comments (0)

Skip to main content