4 ms·
Some arguments would be nice…
by noncoml 4y ago
Some arguments would be nice…
- Supermancho 4y agoDiscussions about syntax devolve rather quickly into arguing about sources, because there are so few studies done and everyone has an opinion (or cause). Bash syntax is horrid and that's enough for me. Just wait a couple decades and languages slowly improve or they die. Sometimes it takes a long time (in comparison to a person's lifespan) and that's ok.
- deleted 4y ago[deleted]
- bscphil 4y agoEven giving an opinion would be something. What's something you like better about PowerShell? I can easily say something I dislike about it: This form `Verb-LongNoun` for function names used in PS is somewhere between alien and maddening. It's difficult to type, difficult to remember, and isn't an obvious improvement over `lowercasename` which is typical of basically every other shell. I guess the idea is that you don't have to worry about naming collisions with programs in your path? That's never been an issue for me when writing shell scripts though, not even once.
- vips7L 4y agoYou don’t have to use Verb-LongNoun. PowerShell will fuzzy match as long as it’s not ambiguous. Verb-L might be enough. If you’re in an interactive shell they’re already aliased to shorter forms like “gal” for Get-Alias or “gci” for Get-ChildItem. I’m not OP but things I like about PowerShell: - Objects instead of text - The entire C# std lib is accessible - One tool with the same UX vs several different tools with different UX.
- wruza 4y agoWow, your first paragraph alone is why I’ll never even touch PS.
- HyperSane 4y agoThe mostly consistent Verb-Noun naming convention is a good thing about powershell and isn't an issue due to very good autocompletion is PowerShell editors. But the single best feature of PS is that you pipe structured objects to the next command, instead of raw text that must be parsed, which is prone error. Every command output object can be exported to JSON with ConverTo-JSON. You can export the entire Active Directory as JSON with Get-ADObject -Filter * | ConvertTo-JSON > AD.json Some more examples. Get-ChildItem -Path *.txt | Where-Object {$_.length -gt 10000} | Sort-Object -Property length | Format-Table -Property name, length Get-Item -Path HKLM:\Software\MyCompany | New-ItemProperty -Name NoOfEmployees -Value 8124 Get-Process | Sort-Object -Property handles
- bscphil 4y ago> But the single best feature of PS is that you pipe structured objects to the next command, instead of raw text that must be parsed I agree with that, but other advanced shells (xonsh, elvish, or even fish) also have this feature.
- HyperSane 4y agoI like Powershell's implementation the best.
- IncRnd 4y ago> Just wait a couple decades and languages slowly improve or they die. Bash has been around for 33 years. Much of its syntax has been around for 52 years through sh.
- Supermancho 4y agoAlmost everything that Bash is good at, other languages have already adopted with a superior syntax. The only thing Ba/sh type syntax has going for it is the *nix ecosystems (note the parallels with powershell). That will keep it used for the rest of our lifetimes, if you're only interested in short-term thinking. Ofc this is bigger thinking than the Powershell vs Bash debate, per se. Powershell is more useable as a language, if not by pure syntactic maturity, than by features alone. There will always be someone who will disagree with the obvious, but there's no doubt that the algol syntax is going away...however long that will take.
- IncRnd 4y agoPowershell is good at managing windows boxes. I've tried running powershell on linux in order to manage a windows network from the output of a (bash) script that ran on a linux machine. It didn't work. Powershell is a husk of a language on non-windows machines. The important modules like AD are missing, so it won't work properly on non-windows machines.
- notaquaker 4y ago
- HyperSane 4y agoBash makes simply things simple and hard things impossible while being ugly as sin.