Conversation

Notices

  1. Pondering powershell some more I'm asking myself the question whether I would use it on Linux as well. The more I learn of it the more the answer is: yes, as long as I don't need to run external programs. But looking back at my scripting quite a lot of it doesn't really require external programs other than for reasons that bash is not suited for any kind of data handling beyond the most utterly trivial and of course doesn't include a full HTTP client. For a typical hackjob of downloading some JSON and interpreting it a bit to get at the interesting parts plain powershell is quite sufficient and if I need more the .NET stdlib should be more than enough. However if I do need external commands (like git) powershell rapidly becomes a PITA because of things like interpreting any output on stderr as failure whereas linux programs often use stderr as a debug message channel. 

    Wednesday, 17-Jan-18 16:50:48 UTC from community.highlandarrow.com
    1. @verius Um, if you don't need external commands, there are Python and Perl and have been for far longer than PowerShell.

      Thursday, 18-Jan-18 13:47:13 UTC from loadaverage.org
      1. @xrevan86 Granted, I'd probably use Python on Linux. But Powershell has a rather strong feature, though it isn't a new one. It's easy to program in pipeline style - adding maps, filters, folds step by step - when you're used to thinking functionally and Powershell is one of the few languages that combines ease of experimentation and a flexible (dynamic) type system with a functional workflow style. I've looked quite a bit for functional languages but most are statically typed and while that's great for larger coding it's not pleasant for scripting. There are a few languages that support the functional pipeline style but pretty much all of them as lisps and that kinda doesn't do it for me.

        Thursday, 18-Jan-18 18:28:17 UTC from community.highlandarrow.com