Hallelujah - eviltoast
  • wizardbeard@lemmy.dbzer0.com
    link
    fedilink
    English
    arrow-up
    3
    ·
    edit-2
    1 year ago

    I do a lot of work in PS and I don’t find it that bad. But you forgot what’s even dumber about their function naming conventions.

    Function names are supposed to be a single word verb, then the dash, then the rest. But not any verb, you’re supposed to use one from PS’s list of acceptable ones which has some really weird omissions. And they break their own single word verb convention with “acceptable verbs” ConvertTo and ConvertFrom (ConvertTo-SecureString, ConvertFrom-Json), which are the only exception to one word verbs before the dash.

    Function names are definitely one of my biggest peeves with it.

    Additionally, their basic comparison operators are dumb as hell. How is “-le” better or clearer in meaning that “<=”? -ne instead of !=, but == isn’t just -e, it’s -eq. And you can’t slap an n in front of other comparators for not, -nle isn’t a thing. You gotta wrap the whole comparison in parentheses and slap an ! on the front or slap -not in front. But don’t try to do !-le, because that’s also not a thing. It’s not terrible but I refuse to believe that -eq is more readable than ==

    • ______@lemm.ee
      link
      fedilink
      arrow-up
      2
      ·
      1 year ago

      Functionally speaking, PS is a really good shell language. Its minor things about it that I dont enjoy. As you said, it feels like the language design has some poor decisions.