4 ms·
Agree, apart from PowerShell which is a bastardised mutant crawling snail spawn of satan. It's like using a VAX 11/780 over a 300bps dialup. SMS messages have a
by csmuk 13y ago
Agree, apart from PowerShell which is a bastardised mutant crawling snail spawn of satan. It's like using a VAX 11/780 over a 300bps dialup. SMS messages have a higher throughput.
This is almost entirely because it uses the CLR which has terrible inefficiency due to immutable strings, the CLR startup time and insane cost of reflection.
- nailer 13y ago> the CLR which has terrible inefficiency due to immutable strings, the CLR startup time and insane cost of reflection That's true, PowerShell is slower than bash. It does more, and that has a cost. That said: it's by far the best designed shell in terms of syntax, and actually separating presentation from logic. Eg, print me a list of processes started in the last hour (from memory, I don't normally use Windows) ps | ? StartTime -gt $1HourAgo | kill Notice the lack of silly things like creating regexs to represent time? Unix shells are MS Word. Powershell is LaTeX.
- angersock 13y agoAnd look at all the people who use LaTeX! (This is pretty much a textbook example of the New Jersey worse-is-better style...fitting, since it involves Unix directly.)
- csmuk 13y agoAbsolutely not. It's terrible. Some more reasons to hate it: 1. It can throw a message box or prompt on the screen without any notice. Precisely how this is handled from a scheduled task is "interesting". 2. If you're non US locale, you get different date formats pop out of get-date, gci and CLR DateTime. This at some points in time scares the living fuck out of me as an implicit cast to string can swap day/month around. 3. Changes every year or two. Features features features. Gotta learn them all. Pokemon time. 4. Module system is a piece of shit. 5. Signing is so friction inducing that everyone just turns it off to get shit done. you compare to bash here. Bash doesn't do much at all. This is the point. It leverages other tools to do the work. In your example you mention regex for parsing dates. This is a bad approach. "date +%s" returns sortable integers which you should work with. PowerShell is Word. LaTeX is a felt tip. Bash is a fountain pen and a steady hand.
- nailer 13y agoTotally agreed re: module system and interactivity. As I mentioned, it's only in terms of syntax I think Powershell is excellent. > "date +%s" returns sortable integers which you should work with. Date returns text, not integers. Your shell doesn't understand that there are not more than 60 seconds in a minute. You might argue that people shouldn't use a shell to parse dates, and pass the text onto a proper tool to read it. That doesn't change the fact that Unix admins, like Perl developers, try and do this all the time. Maybe the best thing about posh it stops people from doing stupid things. The LaTeX/Word analogy was simple: powershell separates content from presentation. bash does not.
- ajross 13y agoThis isn't an issue of shell syntax, you're pointing out that the ps tool emits structured output which can be queried in standard ways by downstream filters. Which is great, as a user feature. Now explain how to write a "ps-like" command which emits mostly the same stuff and coexists in the same universe. Now things flip: unix is straightforward and easy (everyone understands how to emit text, and you can do it from literally every programming environment there is) and windows is arcane and inscrutable, and works only with whatever .NET framework understands that log stream. Fast forward a few decades, and examine the size of the ecosystems built around "simple tools and text streams" vs. "custom logging format plus cute syntax". It's a forest for the trees argument. Microsoft, as always, optimized for the wrong part of the problem. In this case: the admin experience is great, at the expense of the developers of the tools those admins would need to run.
- nailer 13y ago> Which is great, as a user feature. Yes, exactly. There are far, far more users than complementors (tool creators) in this space. Optimising for users is excellent, and smart tool creators will see and appreciate the benefits.
- ajross 13y agoExcept they don't, as witnessed by this thread. Powershell is a ghost town. No one uses it, because there are no meaningful tools that use it. With ssh and rsync and git and bash and whatnot, I can script up a remote deployment or replication system for a simple task in a few hours. To extend your ps example, I can throw in a little awk or perl and spit out a clean report of suspected memory hogs. Where is the powershell ecosystem? It doesn't have one, sorry. Syntax can only take you so far, and as I pointed out Powershell designed for syntactic power at the expense of extensibility. And it made the wrong choice.
- nailer 13y ago> Powershell designed for syntactic power at the expense of extensibility. And it made the wrong choice. A decent syntax is orthogonal to extensibility: Powershell uses .net because Microsoft likes .net. A Python, Ruby or node-based equivalent wouldn't use .net, and still have a clean syntax.