To be fair to OP, I would then go on to label these people as equally ignorant:
> A lot of people coming from the Unix-like world of macOS and Linux don't tend to know [PS]. Many people don't know it even exists at all. When I mention the Windows Terminal to people, they think I'm talking about the Windows Command Prompt, a crappy little program
I know that PS and the new terminal is not the same as cmd.exe, and that it has advantages like passing objects through pipes instead of stringly typing everything the way that sh-like shells work. But that's about the extent of it. (The powershell command names though, oh boy, even Java method names are better than that.)
> PowerShell also runs on Unix-like systems through PowerShell Core
I forgot about that. If anyone's interested in this, you may also enjoy learning that you can now run Windows Defender on Linux! And Internet Edgesplorer! The software we've all been waiting for, according to the Microsoft press release :D. These things amuse me to no end, but more seriously, getting to know PS better and trying out this object passing system does sound interesting.
Similar to how C# is secretly my favorite language, but it's just not well supported on Linux (mono and .netcore with monodevelop or the electron app called "VS Code" are just not the same as the Windows experience, e.g. Windows Forms and the real Visual Studio being huge omissions for me).
> Similar to how C# is secretly my favorite language, but it's just not well supported on Linux
C# is not-so-secretly my favorite language (though Clojure is a close second) and I use it pretty often on macos/linux.
IDE wise have you given Rider a try? Imo it's a totally viable Visual Studio replacement for most C# dev, though not as nice for all workflows or related tech.
Worth looking at if you haven't. It's not free, though, so that can blow depending on your tolerance for licensing. I've personally had an all-products pass with jetbrains for awhile now, so doesn't bug me, but ymmv
I also get a lot of mileage out of C# notebooks in VSCode. Honestly, I use C# for a ton of my daily scripting because I built up so many utility scripts over the years in LINQPad on windows, and they were pretty trivial to port
Dude, your comments are way too good to have an empty profile. No, I did not know of Rider, but next time that I get the C# itch again, I'll definitely be looking at what I've been missing out on!
Checking it out quickly, it's from JetBrains (a good sign for software quality) and has a 30-day trial so I'd know what I'm paying for. On the downside, ~175€ is quite steep given that it's not for a commercial purpose and I am currently fine getting my programming done in pluginless Vim. And that's not a one-time payment: that's for the first year. I can't just move on for a while and come back to expect to open up a project file and it to just work :/. I think this is not going to be for me at this price point, though the 30 days trial might be a challenge mode to start and finish a project that I might otherwise never finish at all!
Edit: And I wasn't even yet talking about your comment history. Spotted two insightful comments while skimming the top level of the first page of comments (I stopped there), and that already takes me all the way back to 2015. Not saying you must post more if you don't want to but e.g. the timer tip seems to have helped a lot of people :)
Just to clarify: when you buy you get a license for the current version that is yours to keep and then you get updates through the year, so you can drop back and use an older version if you don't want to keep paying.
Mind you I had the all products pack for a while now, so YMMV.
JetBrains makes damn good stuff. I do C# professionally and even though I use Visual Studio for the bulk of my work, it’s built in refactoring pales in comparison to what JB’s ReSharper provides. (Yes, VS has been catching up but it still has a long way to go.)
Anyway, yeah, Rider by itself isn’t cheap but for not a lot more you can just get the entire JB suite. It includes a whole ton of useful stuff that’s multi-platform and multi-language. When I’m doing Mac dev work, I find Rider to be much better for a lot of things than VS Mac is. (As long as I don’t need Azure integration.)
I could get my employer to reimburse it, but I find it all so useful both for work and for personal projects that I decided it was worth just paying out of pocket and not having to worry about it.
> Dude, your comments are way too good to have an empty profile
Thanks! I really appreciate that. Been kind of a bummer year so it's nice to hear (#layoff problems, so I'm definitely not the only one, and I think that's looking up recently)
I don't think I'd get Rider by itself, either. I was doing consulting for awhile and ended up getting the jetbrains all product thing personally because was jumping between Goland, Rider, Webstorm, and Rubymine, and Datagrip a lot (I honestly don't remember which are paid now). I got it personally because I ended up using it so much. I ended up using CLion (which is paid) for learning Rust, too, which was nice.
definitely check out the 30 day trial. And 100% JetBrains knows what they're doing
Have to dip, but feel free to ask whatever questions and I'll check it out when I get back. No pressure either way.
FYI I tried CLion for Rust, but did not feel any improvement of experience in comparison to VS Code + Rust analyzer plugin, so I cancelled CLion. In fact, VS Code somehow felt better.
I do use Rider 50/50 with big Visual Studio though. Mostly because I feel that the need to eventually switch to Linux is creeping as Windows adds more junk.
I've heard the VSCode + Rust analyzer situation has gotten really good. I think this might have been when it wasn't as solid? I'll have to check out the VSCode situation again sometime.
The one thing I don't like about Rider vs Visual Studio + ReSharper is that ReSharper has some really advanced structural/semantic searches that haven't made their way into Rider. I don't use it a ton, but being able to do queries across the AST annotated with semantic/type info is really useful if you're working on a legacy C# project that's been copy pasted fifty times--once per state (actual thing that I ended up working on)
otherwise, Rider is rad, and I have way more intellij platform bindings and such setup for them all
Just wondering if you're talking about command name length or something else?
Asking because it comes up a lot and almost all the common commands have idiomatic short/terse versions (gci for Get-ChildItem, etc).
No shade, though. No reason you'd know if you don't have a reason to know it.
Would love to hear if I'm making the wrong assumption and it's something else you're talking about. I personally really love powershell, but also get why people love bash. I'm still pretty comfortable with bash because I work in *nix systems mostly, so it makes sense for me to know it, whereas the reverse (with ps) isn't really true for most devs
Yeah that's basically it, so thanks for mentioning abbreviations! I knew they had some aliases (e.g. ls, curl) but not that it was commonplace because any powershell tutorial uses the long form and capitalizes everything (indeed I don't interact with PS a lot). It all feels very design-by-committee. Not sure whether it's a good thing that guides never use the short form: long more readable, but the specific choices of words give me weird vibes and run off blog-width line lengths. OP shows that nicely with the bash version fitting on ~60% of the line (on my screen) but the PS version running out of the line.
A lot has been written about naming things and brevity versus clarity, and while I sit very firmly on the programmer's side as opposed to the math people side (single letter variable names, in weird fonts or languages if they (surprise!) run out of available letters), I think I am more of a bash person than a java person in terms of naming things. Word-ish commands like pushd, kill, read, etc. (taking some bash built-ins here as examples, rather than external programs which may be named arbitrarily) seem a lot nicer to me than either very long commands or acronyms where you basically still have to know the long form to remember it. I'd never have guessed that spps stands for stop-process yet that's the portable powershell form of 'kill' (just looked that one up).
I think this kinda shows the issue, and why I personally prefer ps (as someone who's bounced off bash and NEVER gotten the time to get decent at it, and who rarely needs to use any of these and never at any serious level, so massive grain of salt).
Kill is intuitive to you because you've probably been around tech your whole life, and tech has just used "kill" ever since. It's essentially as ubiquitous as "bug".
That said, if I had to teach someone brand new with next to no skills (the endless goal of making coding easier for the average person and so on), Stop-Process is a hell of a lot easier to teach, or rather, it's much easier to teach them to help themselves.
Since it follows the same naming template as every other powershell command, if you teach them how to use the basic commands like Get-Help/Get-Command, they're a hell of a lot more likely to figure it out themselves without needing assistance. You know that every cmdlet is verb-noun, and you know you're trying to stop a process, so something like
> Get-Command "*process*"
Gives you a short list that is extremely intuitive to figure out.
Now...for something as simple as "kill" you're not expecting a beginner to run a command with a wildcard search. You'll just tell them. But that entire philosophy is extremely helpful when you're in a situation where you do need to figure out the command and don't have the ability to just spend however many minutes on google, and if you teach PS right you get to a point where it's very easy to teach yourself.
Obviously how much this matters in a world of IDE's and search engines and now AI is questionable, but I think that if you redid bash today, it'd follow similar philosophies. Things like touch, grep, and arguably even echo really strike me as "favorites" just because of the inertia/ubiquity.
The convention is to use the short form whenever you are in a terminal for one-off commands, but go for the full name for script files that has to be maintained/read later — which is an absolutely sane policy in my opinion.
Bash is a write-only-full-of-bugs language, comparatively.
100% and I never thought of that before but I can see how you'd get that impression from tutorials.
The VSCode powershell extensions will also give you suggestion squigglies under all of your aliases in a saved script if they're not long-form, but I usually mix and match based on pragmatism.
My use of alias vs long-form usually comes down to two sort of situations:
* Ad-hoc at the shell: all aliases all the time (and make my own if I need to. welcome to my godless wasteland, population: me)
* Shared scripts: Just like any code, do what's idiomatic for the team. Usually it's largely aliases with some long-form
In practice I'd say the formatting consistency situation on teams isn't nearly as bad as SQL but obviously not as good as Go.
For reference, I'm also a huge APL fan, so hit me with arcane symbols in my free-time all day long, but definitely pragmatic balance at work.
I also don't even think of them as acronyms personally. The acronym just sort of means the semantic action in my brain at this point, but I think that's mostly a fluency thing, and can't really speak to it being hurtful/helpful since I'm so removed from when I first started learning it
Regarding not thinking of them as acronyms: yeah I get that. I was wondering how to best phrase that sentence because, indeed, curl also does not stand for C Uniform Resource Locator in my head, or grep for global regular expression perl-style (if I'm remembering that one correctly). It's just curl and grep. However, whereas curl and grep are really treated as names, spps I can currently regurgitate only by thinking of stop-process, and I imagine most such abbreviations will be like that for a while.
totally agree, and yeah, "you eventually memorize all the arcane bits" definitely isn't a point in favor of powershell
there are also some commands I use all the time that don't have built in aliases like the json converters, so that makes cross-machine alias consistency for some important things not great
It's just a knee-jerk reaction people have in any thread where powershell is mentioned. "Hur hur long command names." Doesn't bring anything to the discussion.
I can see where you're coming from, but to me it's not some meme or joke. I find it similarly annoying in Java, for example, and it makes me want to use that language less. Obviously it's only a small part of the whole consideration.
Every common command has a short alias, or often multiple short alias. Get-ChildItem => "ls", "gci". Get-Content => "gc", "cat". These aliases are standardized, you can look them up with Get-Alias (or "gal" ;) ).
It means that working in the terminal, you can use short commands, and when you write a long-term script, you use the long names so that the script is more readable.
What I find great is that flags also have aliases that are standardized across commands.
This is why I'm annoyed at this meme. It just stems from ignorance.
What’s long in Java? It sure longer than the absolutely insane C convention of snrcph whatever, but these AbstractFactoryFactory things are just memes - the Java convention is to prefer full words, but that’s the same in I believe the majority of languages - JS, Rust, Python all use basically identical names, at most casing differs.
Yeah, it can definitely be kind of a meme, but also I've never had a bad time bringing it up in good faith. A lot of people don't even realize it's a knee-jerk meme response to them. OP also doesn't seem to just be MS bashing, and I think there's a reality that the typical linux/macos dev just doesn't have a compelling reason to sink time into vetting PS, whereas I had a reason to learn it and ended up really digging it.
But I do get what you're saying and think it's a common meme that's often unhelpful
I love powerful. I've used it for a long and even though I primarily work on macos/linux now, I install powershell core on everything.
That said, I _started_ using it because I was working on a windows box doing C# and managing windows servers.
There's just not a compelling reason for a dev to learn it outside of personal interest, and I think that's a completely legit mindset, since we all have limited time. I'm even fine with misconceptions--we all have them about something--as long as the person is being a decent human about it (which is why I've enjoyed this thread/comments)
Even with the default short aliases like gci there are only ~100 unique commands/commandlets aliased and 600 commandlets in a default install. Not to mention what happens when you start loading other commandlets. Trying to predicate your usage of PS on just using short commands is also going to fall short in documentation and searches. I recommend just getting used to the fact command names are long. <tab> is a good friend too.
Often mentioned failing of powershell commands is that they went with Verb-Noun, when the reverse would have been much more discoverable. You want to specify what you want to operate on first, Get-<Tab> will be much less useful then Process-<Tab>.
Otherwise, despite their length I do like these long names, you can have aliases for ‘ls’ and alia, and flags fuzzy match.
lol, you know what's funny is that I actually used to have a script like that for windows 10.
I volunteered to help a local nonprofit image a bunch of laptops and they'd bought win 10 home licenses for something like 30 laptops. The whole thing was kind of a nightmare but got most of the adware stripped out, I think, but not all of it. been awhile, so hard to remember
>A lot of people coming from the Unix-like world of macOS and Linux don't tend to know [PS]
We all have different experiences of life but I have never found this to be the case. Linux users are savvy and curious about things even outside their bubble.
The only people I can imagine this being true for is the true greybeards who have been daily driving Linux for 20 years.
Well, you also have an insane amount of linux users who hate on systemd/wayland/gnome non-stop with complete ignorance. Though they are more of a vocal minority given that they are the defaults on most distros.
On the C# IDE front, Rider is excellent on all platforms (even on Windows I prefer it over VS), and a lot of production C# software is now running on Linux. It's not limited the way it used to be.
For PS, the other thing is I think people hear "object-oriented shell" and think every command has to be custom-built to interface with all the others and isn't pluggable like standard pipes, but that is untrue.
Yeah. Reading the 3-pipe solution in bash versus 4-pipe solution in Powershell felt like it was verging on parody. Yes, these object-oriented features are nice - but they're something of a self-imposed problem on an OS that's designed like a database. Even the tools we use to parse JSON in bash aren't all that bad, if you can keep yourself grounded in the world of text processing.
I'm glad that the OP has a workflow that they like, but I'm not really convinced the grass is greener on the other side. I've used a lot of shells, Powershell doesn't really wow me that much anymore.
Nah, passing text around is not a good thing, you can’t even write a properly maintainable script that queries the temperature of your hardware or whatever property you are interested in, these will be one-off hacks, breaking even from a change in locale.
If the long command names bother you so much most have short aliases, but it's worth remembering that the short ones are cryptic and not that instructive if you're not already initiated.
It's not that bad. I'm mostly balking at the idea of `ConvertFrom-Json | ForEach-Object { $_.name }` being any easier to remember than `jq '.[].name' -r`. Both examples seem to "convert" text to JSON with a parser, it's like arguing over the difference between awk and catting into grep. Neither really seem more advantageous than the other.
the `| % [property name]` is shorthand for pulling out some root level property on an object in the pipeline
(just for reference; not really trying to prove any point)
What I personally like about PS in this case is that the syntax of the operation feels very consistent with the rest of powershell, but that's not a dig against jq (I use it a lot when I'm on macos); just my subjective impression, and not an objective claim of quality.
The point is not about being easy to remember (powershell commands and their args can be autocompleted with tab so memorizing them isn't really important). It's about powershell being the object manipulation environment instead of a 3rd party tool like jq. This makes it easier to do stuff with your data with a .Net powered runtime rather than having to manipulate strings using tools with their own built in languages
I'm still a PowerShell novice, but I believe ForEach-Object and ForEach are subtly different, and PowerShell has classic For(Init; Condition; Increment) loops also but it's even more different than those two.
I have seen that, and that's partially why it seemed so confusing to me but at least one difference is
The ForEach-Object cmdlet works much like the Foreach statement, except that you can't pipe input to a Foreach statement. For more information about the Foreach statement, see about_Foreach.
Hey TIL, though, I knew there was a difference (the foreach statement is meant to be typed all lower-cased, since it is not a cmdlet but really a shell built-in but PowerShell is case-insensitive). Get-Help gets you information on cmdlets, not shell built-ins.
Though I was referring to the cmdlet, you're absolutely correct.
> A lot of people coming from the Unix-like world of macOS and Linux don't tend to know [PS]. Many people don't know it even exists at all. When I mention the Windows Terminal to people, they think I'm talking about the Windows Command Prompt, a crappy little program
I know that PS and the new terminal is not the same as cmd.exe, and that it has advantages like passing objects through pipes instead of stringly typing everything the way that sh-like shells work. But that's about the extent of it. (The powershell command names though, oh boy, even Java method names are better than that.)
> PowerShell also runs on Unix-like systems through PowerShell Core
I forgot about that. If anyone's interested in this, you may also enjoy learning that you can now run Windows Defender on Linux! And Internet Edgesplorer! The software we've all been waiting for, according to the Microsoft press release :D. These things amuse me to no end, but more seriously, getting to know PS better and trying out this object passing system does sound interesting.
Similar to how C# is secretly my favorite language, but it's just not well supported on Linux (mono and .netcore with monodevelop or the electron app called "VS Code" are just not the same as the Windows experience, e.g. Windows Forms and the real Visual Studio being huge omissions for me).