4 ms·
Case sensitivity isn't a major deal, but it's another example of the designers trying too hard to be clever and "user friendly". A good scripting language shoul
by ggorlen 4y ago
Case sensitivity isn't a major deal, but it's another example of the designers trying too hard to be clever and "user friendly". A good scripting language should try to reduce friction relative to other programming languages, most of which are case sensitive.
I'd like to see a native OS scripting language that has a low bar of entry, isn't silent on undefined variables and other common mistakes, imposes syntactical consistency like Go or Python, has decent basic data structures and isn't riddled with pitfalls. PS isn't that language.
If Bash and PS were good, it'd be so much easier to bring non-programmers into the command line so they can automate tasks and hack on their systems. Unfortunately, these languages aren't doing that, much less passing the usability test with most programmers who'd just assume script with Py, Perl, JS, or whatever their preferred language is.
- Riverheart 4y agoPython/Perl/JS/Ruby aren’t shells so the busy sysadmin doesn’t need to ask themselves at what point they rewrite their script in a sane language and a Windows dev won’t typically use those languages, especially as you’d have to call the Win32 api for lots of behavior or bring in many external packages for things PowerShell includes for free. In terms of ease of use PowerShell and ISE is available on every PC, is more consistent than Bash and more powerful than a user friendly shell like Fish. I don’t know how you get easier than Get-Foo, Set-Foo. Bash doesn’t really offer anything out of the box except the ability to glue external commands together and most people use it because of its availability and portability rather than its virtues as a language. Zsh, Fish, Elvish, Xonsh haven’t managed to displace it and Xonsh is even written in Python. The only thing I can think of that could make automation more friendly to nontechnical users is something like autohotkey to mimic manual interaction.
- ggorlen 4y agoThe point is, if a developer is resorting to another language just to write a 20 line script with a data structure, a loop and control flow, that's a failure of the shell. I don't want to have to use anything other than PS to script on Windows, but I'm often forced to in order to be productive. It's not saying much for the language that Windows sysadmins use PS primarily. Like Bash, the reason people use it is availability, not language virtue. See last year's Stack Overflow developer survey, where Bash was more popular than PS (29% (Bash) to 12% (PS)[1]) and loved (57% (Bash) to 43% (PS)[2]). I don't like Bash. I'm using it as a yardstick to show how disappointing PS is. [1]: https://survey.stackoverflow.co/2022/#most-popular-technologies-language https://survey.stackoverflow.co/2022/#most-popular-technolog... [2]: https://survey.stackoverflow.co/2022/#technology-most-loved-dreaded-and-wanted https://survey.stackoverflow.co/2022/#technology-most-loved-...
- eviks 4y agoPython is a shell, the one you mentioned, xonsh And PS doesn't include things for free, it brings a lot of baggage from the same company that made the win32 APIs unergonomic, though it does have a few structural advantages like typed data (the easier part to Get-/Set- could be losing the pinky-typed dashes since you already separate by Case, and for such common things you could even just use gFoo sFoo) But none of these options are anywhere close to the ergonomics needed to bring non-technical users into the fold
- Riverheart 4y agoWhat I mean is Xonsh isn’t a core part of Python. If it was, I’d be very tempted to make it a daily driver as Python is a very nice language.