Why PowerShell? Responses

2019-07-08

Scoop is a package manager for windows that is written in PowerShell. In their documentation they list some well-thought-through reservations for using PowerShell and their reasons for using it anyway. These are my responses to their reservations.

  • The Verb-Noun verbosity, commands that were seemingly not designed to be typed

    • I disagree. Having default-verbose commands helps clarity and discoverability. Most commands used interactively have aliases already defined. If you find yourself regularly typing one that doesn't, make your own. If it makes sense, share it. In addition, the auto-complete works well
    • The ISE—a GUI for a command line interface. I know the commands are hard to type—but is point-and-clicking a solution?
    • It's true that PowerShell doesn't have a high-quality integrated development environment. ISE is a start and really shines in its intellisense (which doesn't require mouse interaction), but just doesn't cut it and it looks like it isn't being developed any more. Effective development environments can still be set up, but they won't be integrated. Sadly though, no other scripting host I've seen has as slick intellisense as ISE.
    • Caveat: I haven't tried any of the paid development environments, those may be effective.
    • The name PowerShell, and the unofficial abbreviation PoSH. Cringe.

    • meh. I usually write 'PowerShell' for consistency's sake, use 'PS' to abbreviate and it hasn't caused me any aneurysms lately.

    • Everything's an object! ends up feeling clumsy. Sometimes text is just easier to work with. Support for primitives, arrays and hashes would have been enough.

    • This is only partly true. If you're primarily working with text or trying to emulate the unix scripting philosophy it will definitely feel clumsy. If you're working within .NET/PowerShell idioms then everything will feel effortless. Most of the time it will be somewhere in between. This is also true of any scripting language.

    • Modules. Who knows how they work?

    • I won't claim that they're perfect or to know all their secrets, but I'll say they're one of the nicer features of PowerShell. Creating and using modules has been pretty painless for me.

    • Doesn't seem like a first class shell within Windows

    • Yes. Hopefully this is changing. It seems like windows 10 is a major step forward for this.

    • The built-in parameter parsing isn't good

    • I disagree. Parameters are easy to set up, and because most commands use the built-in parsing you can have reliable expectation about how any given command will parse. The built-in parsing is a huge win for discoverability since parameters are automatically shown when you Get-Help <command>. If you don't like PowerShell's parameter parsing you can ignore it and roll your own, but overall I think this is one of the best features of PowerShell.

    • A heavy 'sysadmin' feel that makes developers/devops sad
    • Could be, but not really sure what this means.

I also have my own reservations for PowerShell

  • Tentatively, I'm not sure how the Verb-Noun philosophy will play out long term. Honestly, it has worked really well for me so far. I've been able to find conformant command names without too much trouble and it has helped me structure modules in a fairly consistent way. I guess I just find myself skeptical about this kind of crystallization. We'll see.
  • The language syntax. Once you get used to it, it is actually very reasonable but there's no denying that is seriously steepens the learning curve early on until you get that it's a combination of several different syntax styles.
    • Despite this, I don't think the syntax is a valid reason for broadly avoiding the language because: 1. The syntax is actually consistent and well-thought-out, even if it doesn't initially appear so, and 2. it is well documented.
  • I kind of worry about the language being too 'heavy'. In that I'm not sure that if Microsoft became a bad actor that the independent developer community would be able to successfully fork it and continue on. There's some hope in the Mono development community, but Microsoft's move to cross-platform support may end up neutering them. We'll see. (Caveat: I have no idea what I'm talking about)
  • PowerShell seems to have a pretty big, healthy community, but in my current workplace basically no one uses it so I can't really expect anyone to invest time into it. Don't know how widely-applicable this is.