3 ms·
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
by lucb1e 4y ago
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).
- smoldesu 4y agoYeah. 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.
- emodendroket 4y agoIf 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.
- smoldesu 4y agoIt'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.
- shortrounddev 4y agoThe 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
- emodendroket 4y agoI find the former much more self-explanatory than the latter but, for instance, can't ForEach-Object be written as for?
- cyberbanjo 4y agoI'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.
- deafpolygon 4y agoForEach-Object and ForEach are the same thing. Get-Help ForEach-Object ... ALIASES foreach %
- cyberbanjo 4y agoI 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. https://learn.microsoft.com/en-us/powershell/module/microsoft.powershell.core/foreach-object?view=powershell-7.3#notes https://learn.microsoft.com/en-us/powershell/module/microsof... And another appears to be performance PS /home/me> $time = (Measure-Command { >> 1..1E4 | ForEach-Object { >> $_ >> } >> }).TotalMilliseconds PS /home/me> [pscustomobject]@{ >> Type = 'ForEach-Object' >> Time_ms = $Time >> } Type Time_ms ---- ------- ForEach-Object 144.558 PS /home/me> $Time = (Measure-Command { >> ForEach ($i in (1..1E4)) { >> $i >> } >> }).TotalMilliseconds PS /home/me> [pscustomobject]@{ >> Type = 'ForEach_Statement' >> Time_ms = $Time >> } Type Time_ms ---- ------- ForEach_Statement 17.621 https://devblogs.microsoft.com/scripting/getting-to-know-foreach-and-foreach-object/ https://devblogs.microsoft.com/scripting/getting-to-know-for...
- kaba0 4y agoNah, 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.
- andylynch 4y agoThere was a time when Internet Explorer was possibly the best UNIX browser. We ran it on Solaris.
- doorhammer 4y ago> The powershell command names though 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
- justeleblanc 4y agoIt'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.
- doorhammer 4y agoYeah, 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
- lucb1e 4y agoI 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.
- kaba0 4y agoWhat’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.
- doorhammer 4y ago> 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
- lucb1e 4y agoDude, 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 :)
- doorhammer 4y ago> 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.
- emodendroket 4y agoOn 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.
- c7DJTLrn 4y ago>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.
- kaba0 4y agoWell, 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.