25 comments

[ 2.9 ms ] story [ 61.2 ms ] thread
Microsoft lost the console game. Linux won.
If more and more people are realising that command line interfaces were the right thing all along and shunning GUIs, what is actually the point of Windows any more?
Who says you can't have both? I spend a lot of my day in a console/terminal window, but I'm not about to use Lynx for the bulk of my web browsing.

As for TFA, this is astoundingly overdue. This most recent gig involves using Windows for the first time in years. No worries, I'll load that new WSL I've been hearing about. Hey, look! A bash shell! On Windows! What will they think of next?

Except it's wrapped in a Windows console, which blows goats just as much as it ever did, the evidence list for which I need not repeat. MSFT can make some damned nice GUIs for simplifying complicated tasks. I guess the fallout is that their text-based UIs don't get as much love.

> I'm not about to use Lynx for the bulk of my web browsing.

Lynx isn't a CLI program. Curl is a CLI program. I agree that it's preferable to use Firefox over Lynx, but all of that works fine on X11. The point of Windows is it does everything using graphical interfaces.

> The point of Windows is it does everything using graphical interfaces.

Really? There's people who'd say

> The point of Linux is it does everything using the command line

Which would also be inaccurate.

That's what I'm asking, what is the point of Windows if not that? It's name specifically refers to its graphical capablities. The point of GNU/Linux is it's a free UNIX-like operating system. If everyone is using CLI interfaces, or portable graphical software like web browsers, why would anyone choose Windows over GNU/Linux?
It's name specifically refers to its graphical capablities.

You're going to center a technical discussion around what the marketing department decided to call it? Windows does much more than draw pretty pictures on the screen. I would think this to be common knowledge amongst the HN crowd.

The point of Windows is it does everything using graphical interfaces.

That's not even remotely true: https://msdn.microsoft.com/en-us/library/ee391626(v=vs.85).a...

You're knowledge of Windows is either lacking or based on misinformation. Which is fine, but it's probably not worth arguing the point anymore.

Why not just answer the question? Why go straight for an attack? By asking a question am I not making it abundantly clear that my knowledge might be lacking? I've not used Windows for more than ten years. I really do not know what it's for now apart from not using commmand line which is so often stated as the reason for not using Linux.
it might be more... but its still clearly not much. How many people with macbooks do you ever see pop open the terminal? I've seen even developers who've never had more than the most minimal interaction with command line interfaces. The normal person has likely not had even that much, and isn't going to switch unless absolutely forced to.

It might be the right thing, but relatively few actually recognize it as such, even if developers often do.

The point of Windows is Win32 and DirectX. At least for me: those are the two reasons I can't move to any other OS.
Command line interfaces are the right thing for server / workstation administration (both local and remote).

But what about everything else? Productivity, gaming, browsing?

Command line interfaces are also used to pass config options to an application. For instance, Firefox enables users to select which profile will be used by passing a command line parameter, or if a new separate process should be spawned.
The point is to take those devs disappointed with macOS as pretty UNIX to GNU/Windows.

I am pretty ok with Powershell and the state of command line on Windows since ever.

Windows has a better shell.

Practical example from a few days ago: here's feross' script to find compromised eslint-scope for Linux/Mac.

    find . -type d -name "eslint-scope" -print0 | xargs -n 1 -0 -I % sh -c "(cat %/package.json | npx json version) && echo '(at %)'" 
Here's an equivalent for Powershell:

    $results = @{}
    ls -recurse -filter "eslint-scope" | foreach {
      $file = "${_}\package.json" 
      $version = cat $file | convertfrom-json | select -ExpandProperty version
      $results.Add($file,$version)
    }
    echo $results | format-list
Rather than scrape for regexs, you're using objects.Rather than using xargs to iterate, you're actually iterating. JSON is built in, you use 'select' to pick the property you want. Formatting is seperate from presentation.

You can use (and probably should) use Python on nix for similar cleanliness, but Powershell does all this and still feels like a shell. It supports emacs bindings (you use emacs binding on bash by default, regardless of which editor you use), readline, you have a profile, and all the good things you expect from *nix (Windows /terminals/ generally suck, but using the inbuilt terminal with groupy it's decent). It's just way nicer, at the expense of a little learning.

Powershell doesn't feel like a shell to me at all. It's hideously inconsistent and somewhere between shell scripting and programming. You're right that Python is by far the better tool. Powershell only had to beat its incumbent, cmd, which is awful. Nobody would switch from bash/python to Powershell.

Also, you can totally pipe into while in bash. There is no need to use xargs there. You can even deal with spaces in filenames if you need to...

> Nobody would switch from bash/python to Powershell.

I've used bash for 20 years, worked at Red Hat and IBMs Linux Group and my name might be in your OS. I switched from bash/python to Powershell.

> It's hideously inconsistent

How so? It's the only shell I've ever used where you can guess most commands. That's a massive achievement.

> There is no need to use xargs there.

Sure, I'd just use -exec and a fat lady. The example still shows the differences between

- treating everything as strings then scraping with regexs and other string manipulation tools

- using objects

> You can even deal with spaces in filenames if you need to...

A file name is an attribute of the file (inode/fileID). If you have to think about whether a file name has spaces or not you're scraping, rather than treating it as a single string-type attribute. This is why bash has a reputation for being brittle.

Does copy and paste work yet? I mean, it always sort of worked, but it was painful to use.
as of win10, but too late for me to care.
Thanks, today I learned something.
Go to settings, enable it, save configuration.

Really painfull.

>Windows should finally be able to have reliable, effective tabbed consoles, with emoji support, rich Unicode, and[...]

Please don’t tease me... It’s been a long time coming. Hope they deliver.

I'm a long time user of command line. While it has its place and usage, I lately think: why not punch cards then? That would be a fine topic of the next craze.