The PowerShell Manifesto Radicalized Me
Posted by deepCelibateValue@reddit | programming | View on Reddit | 28 comments
Posted by deepCelibateValue@reddit | programming | View on Reddit | 28 comments
gredr@reddit
... well, not really, since it was challenged directly in 2006 when PowerShell 1.0 was released, and based on your narrative, had been for some time before that, by Mr. Snover if nobody else.
Did he? Really? There were multiple ways to run Bash on Windows in 2006 (and much earlier), not to mention SFU. Maybe the problem is that Bash's scripting language is... pretty bad, honestly.
arpan3t@reddit
Trying to defend Bash by saying you should move to a full-fledged programming language if your shell scripts need basic functionality out of the box is a wild take!
I haven’t made it through the full article, but what I have read isn’t great.
Sauermachtlustig84@reddit
This is a good point. Bash scales badly - its great for \~50 lines? Then it gets annoying. Powershell scales from these 50 lines to whole programs. But it has it's wards, mainly the clunky syntax.
arpan3t@reddit
PowerShell is by no means perfect, but no language is. I’m curious what you consider clunky about its syntax though?
When compared to bash, with it’s inconsistent statement delimiters
if fi,case esac,for ~~rof~~,do ~~od~~, multiple expression evaluators( ),(( )),[ ],[[ ]], etc… ironically PowerShell (influenced by bash) doesn’t seem at all clunky imo.Sauermachtlustig84@reddit
I really dislike how param are declared, especially if you use descriptions.
How do I get help messages to appear for my Powershell script parameters? - Stack Overflow
That's far from a well discoverable path.
It's output-stream design is also confusing: about_Output_Streams - PowerShell | Microsoft Lear especially if you need to use it more than Write-Output
Finally, I dislike it's weird S_ syntax - I always need to look that one up. But might be on me.
arpan3t@reddit
I guess that would be subjective. With the parameters it’s pretty flexible:
are all valid. The help doc strings also have a few options. The full <# .DESCRIPTION #> can go before the function, at the beginning of the function. You can redirect to external help file. You can just use comments above the parameter, etc… idk what’s clunky there.
The streams can be confusing for sure. Especially with the output, information, and host.
I’m guessing the last one is the psitem and yeah that can get confusing too.
R_Sholes@reddit
The docstring quirk is that you must include a
<# .SYNOPSIS #>or<# .DESCRIPTION #>etc. (even if empty) to get a proper parameter description from Get-Help, e.g.shows "PARAMETERS // -foo // Description goes here" in " without the first line. Almost feels like a bug, tbf.
help whatever -detailed, but only "-fooI personally like
params()for the scripts' top level, feels cleaner than requiring some sort ofmainfor that (also parameter tab completion and help for scripts - including F1/Alt+h with readline support - is really nice if you've got any complex scripts).Not a fan of
function ... { param( ... ) ... }tho.arpan3t@reddit
The PowerShell engine uses the comment block to determine that the comment line above the parameter is the description and not just a regular comment line. It treats the comment line as
.PARAMETERin the comment block. It’s a little odd, but imo so is putting the comment in the param block.roerd@reddit
If only the article had given another explanation that might counter that argument ... wait, it did, it mentioned that, unlike Unix/Linux, Windows doesn't expose most of its system internals as text, so traditional Unix scripting can't interact with Windows the same way that it can interact with Unix-like systems.
gredr@reddit
Whether or not Windows exposes internals as text is orthogonal to whether bash's scripting language is good.
Solonotix@reddit
The point isn't running Bash on Windows. The point for PowerShell was making Windows server administration less of a headache. When Snover tried to present that problem initially, he was ridiculed and demoted. The "dirty work" here is using a revisionist take on history to convince those who don't know any better that you have a solution to all their problems.
The article isn't about how great PowerShell is. The article is demonstrating how you can convince suits in charge that your new project is worthwhile and should be revered.
Sorry-Transition-908@reddit
Please don't use medium. :/
fucking_idiot2@reddit
i'm out of the loop. have they done something controversial?
Deranged40@reddit
I think it's just that they've become the new blogger. It's frequently where you'll find the lowest effort blog posts.
fucking_idiot2@reddit
"please don't use it" makes it sound as if it's immoral to support it so i thought it was political
Deranged40@reddit
Yeah, the immoral part purely came from you
roerd@reddit
First you make statements without giving your reasoning, and they you get very judgemental about people making guesses about your reasoning because of that. Maybe you should reflect about your communication style yourself.
fucking_idiot2@reddit
mf are YOU okay?? 😭
axonxorz@reddit
Oh my, someone asked if a corporation was shitty, what a surprising situation that never happens to the people who frequent this sub.
... /s
Why else would someone even ask?
Tunivor@reddit
It was a reasonable conclusion and you’re being condescending about this for no reason. iD ReFleCt On tHAt iF I wErE YOu
TOGoS@reddit
Will publishing a blog post to somewhere that's not Medium make it higher quality?
Deranged40@reddit
It's that it will usually take more effort to post elsewhere, and that effort alone seems to filter out a lot of the lower hanging fruit.
TOGoS@reddit
It sounds like what you really want to say is "Keep posting your shitty blogs to Medium because I like to use that as a signal that it's low-quality post, but if you write an actually good one, post it somewhere else"
But then people will just learn that posting somewhere other than Medium gets their blog more exposure and that signal will no longer be useful.
My point is: I don't think it's useful to say "don't use Medium" unless there's a problem with Medium itself. Which there could be, for all I know, but it hasn't come across in your comments.
roerd@reddit
My guess would be that they don't like that many of the articles on there are behind a paywall, even though that's not the case for this one
fathed@reddit
I love it when rants really like this really expose than the unix haters handbook needs to be read by more people. It's free to read online.
CLI is the problem in the book, not the solution.
spaceneenja@reddit
Ok bruh, this article is clearly for people with ultra high IQs only so I am going to skip it.
dreugeworst@reddit
I don't fully agree with the defense of shell scripting given by the author. Yes, it's very useful, but it has many sharp edges and constantly having to parse text makes many scripts brittle. I'm glad PowerShell came along to show us an alternative, even if I never grew to like PowerShell myself. It's probably the main reason I'm using NuShell now
Luolong@reddit
Yes, for some data wrangling objectives, NuShell is awesome!