6 ms·
Only problem is Powershell's commands are abysmally slow in comparison to chaining together Linux terminal commands that are written in C. Powershell is a supe
by 7thaccount 3y ago
Only problem is Powershell's commands are abysmally slow in comparison to chaining together Linux terminal commands that are written in C.
Powershell is a super neat language though.... especially if the Microsoft team that manages it would work more with the team that does more for SMEs and not just DevOps. The overwhelming majority of windows users doing regular business work have to deal with crufty stuff like VBA or over engineered stuff like C#. I was really hopeful for Powershell, but it seems like it's almost entirely to serve IT administrators or software developers. I wish that very capable team would do things like add a fairly simple GUI DSL or form designer with the tool. I know it can hook into WinForms, but that's a lot of effort and requires more C# background. There are probably millions of business analysts that would love to build little simple GUI apps without investing weeks of effort. The current approach is to just use Python, but that has it's own bag of problems for those that can do a little coding, but aren't full time developers. It just seems weird that Microsoft never invested in a language for SMEs that would integrate well with the OS and Microsoft apps and tooling.
- wvenable 3y agoPowershell is a terrible "language". It's fine for sysadmins to do sysadmin work but why would you want to subject business analysts to that level of unix shell inspired weirdness. Microsoft already has VB.NET which would serve that market much better. Give me C# over PS any day.
- mixmastamyk 3y agoIt’s not Unix shell inspired at all, that’s the problem.
- wvenable 3y agoOh it is, just in all the worst ways. I mean look at this: $value = 10 if ($value -eq 10) { Write-Host "Value is exactly 10." }
- 7thaccount 3y agoI actually find that very readable. What is the problem? The weird part of PS is the piping, which doesn't always do what you think it should as everything is an object instead of text.
- pjmlp 3y agoPerl users feel right at home.
- ptx 3y agoAt least it doesn't let you do this (as far as I can tell) so it seems slightly better in that aspect: value="1 -o 1" if [ $value -eq 10 ]; then echo "Value is exactly 10." fi The syntax is terrible, though – if these operators are not actually options for a command, which is the context where the leading dash makes some kind of sense, why make them look like that? Also, why does the documentation[0] talk about statements returning values? I've never seen the terminology used that way before. Usually expressions evaluate to a value and statements can consist of an single expression. [0] https://learn.microsoft.com/en-us/powershell/module/microsoft.powershell.core/about/about_logical_operators?view=powershell-7.4 https://learn.microsoft.com/en-us/powershell/module/microsof...
- jodrellblank 3y agoWhat else would the operators be? They can't use `>` because that does IO redirection, they can't use `|` for OR because that's piping. They could use `==` for equality but then what symbols would -ceq and -ieq be? What symbols or what else would work for `-match` and `-in` and `-cmatch`? If they were just `eq` or did use `==` how would that work for when they are actually options to a cmdlet such as `| where-object -eq $x` ?
- wvenable 3y agoThey didn't need to copy any awful shell syntax. We have decades of programming language development but Powershell cribs from oldest and most cobbled together environment. Give up on the old syntax for IO redirection and piping. I also don't even like their verb-noun philosophy because it's impossible to figure out what the commands are and there are so many. It's still all objects and methods underneath but you can't auto-complete anything.
- pjmlp 3y agoThat is actually an advantage.
- mixmastamyk 3y agoIt’s not when they came up with something worse. With the exception of object pipes.
- 7thaccount 3y agoVB.net is still .NET which is fairly complicated and verbose. It's basically just a visual basic skin over C# right?
- jve 3y agoTerrible? For writing GUI yeah, sure, not that it was designed to do it. Just it's possible to tap into .net world, that's all.