News for hackers. Stuff that matters.
Re:PowerShell Inventor Jeffrey Snover Interview by liminal on Wednesday December 08, 2021 @11:18AM (#29486584)
I want to like PowerShell, but some basic design decisions really irk me. Specifically Verb-Noun command names seem so backwards. I want to start with the domain and then specify the action I want to perform in that domain. Noun-Verb would make so much more sense (and naturally group commands together when sorting alphabetically). Which brings up the other annoyance: long capitalized names with dashes in the middle. It's so annoying to type! Repeatedly typing dash followed by a shift-key combination adds enough friction to notice the burn. Finally, options are also too long. Compare `rm -rf` with `Remove-Item -Recurse -Force`. Capitals, dashes, long words... It's too much!
Re:PowerShell Inventor Jeffrey Snover Interview by gruez on Wednesday December 08, 2021 @11:29AM (#29486774)
>Specifically Verb-Noun command names seem so backwards

I agree that doing noun-verb would be easier for autocompletion purposes, but I suspect that ordering was chosen to align more closely with english grammar, specifically https://en.wikipedia.org/wiki/Subject%E2%80%93verb%E2%80%93o...

>Finally, options are also too long. Compare `rm -rf` with `Remove-Item -Recurse -Force`. Capitals, dashes, long words... It's too much!

but they're far more readable. You might be able to remember what -rf does for rm, but what does -o mean for curl? What's the difference between -o (lower case) and -O (upper case)?

Re:PowerShell Inventor Jeffrey Snover Interview by vips7L on Wednesday December 08, 2021 @12:22PM (#29487569)
Remove-Item is aliased on most systems to rm as well and pwsh will fuzzy match switches.. so you end up with:

    rm -r -fo
Not that much more verbose than the unix rm -rf
Re:PowerShell Inventor Jeffrey Snover Interview by AnIdiotOnTheNet on Wednesday December 08, 2021 @11:34AM (#29486849)
I like PowerShell, but I'll agree with your first criticism, Verb-Noun makes less sense than Noun-Verb. At least it is pretty consistent about naming.

Complaining about long capitalized names with dashes in them is a little weird in a language that is both case-insensitive and has tab complete for everything though.

Re:PowerShell Inventor Jeffrey Snover Interview by pastaguy1 on Wednesday December 08, 2021 @12:30PM (#29487692)
IMO, the case-insensitivity is peak powershell.

Possibly a good idea on paper. In practice, at least as an only occasional PS hacker, it always eats up a couple brain cycles.

Re:PowerShell Inventor Jeffrey Snover Interview by AnIdiotOnTheNet on Wednesday December 08, 2021 @01:04PM (#29488154)
I admit the choice of case-insensitivity is questionable, although it is in keeping with Windows's history. I just think it is silly to complain about having to uppercase things when you, you know, don't have to do that.
Re:PowerShell Inventor Jeffrey Snover Interview by liminal on Wednesday December 08, 2021 @02:55PM (#29489602)
But I didn't know I didn't have to do that! I admit to not being competent with it, but all the examples use title-case, so I thought that was required.
Re:PowerShell Inventor Jeffrey Snover Interview by AtNightWeCode on Wednesday December 08, 2021 @11:46AM (#29487033)
This would be my first question. Anybody naming things in IT knows that you go from big to small. From large domains to specific actions. Secondly, how are you supposed to learn which of the 40+(?) verbs to use. Store, Save, Put, Add. Update? In many cases it does not make any sense.
Re:PowerShell Inventor Jeffrey Snover Interview by soverance on Wednesday December 08, 2021 @02:53PM (#29489573)
Have you tried reading the docs? A full list of approved verbs is available, and describes in detail when you should use them and what synonyms they should replace. It makes sense for anyone willing to spend a moment investigating why it's designed that way.

https://docs.microsoft.com/en-us/powershell/scripting/develo...

Re:PowerShell Inventor Jeffrey Snover Interview by AtNightWeCode on Friday December 10, 2021 @12:06PM (#29512305)
Tell that to the people writing PS modules. :) Put, Update, Update, Put? PS is a good example of overdesign imho. Also, one can compare for instance Az CLI with Az PS. Takes at least 5 times longer to do anything in Az PS.
Re:PowerShell Inventor Jeffrey Snover Interview by kaba0 on Wednesday December 08, 2021 @12:24PM (#29487614)
`rm -r -fo` will work just fine on powershell, afaik: there is an alias for remove-item called rm, and flags are fuzzy matched. There are two flags starting with f, so fo is needed here, but I don’t think force is that often needed on windows, so in practise it is just as short.
Re:PowerShell Inventor Jeffrey Snover Interview by psd1 on Thursday December 09, 2021 @07:30AM (#29496604)

    gcm | sort Noun