59 ms·
Can someone explain to me what Linux shell has over powershell that makes it so indispensable for developers? I'm a developer and I don't use Linux. I'm dual bo
by roryisok 10y ago
Can someone explain to me what Linux shell has over powershell that makes it so indispensable for developers? I'm a developer and I don't use Linux. I'm dual booting Ubuntu at the moment because I want to get more familiar with Linux, but I can't see how terminal/bash is so much better?
- smcl 10y agoI can't speak for everyone, but for me a lot of the unix-y utilities and commands tend to do 99% of what I need with a couple of keystrokes and are very composable through piping/redirection. It's possible that equivalents exist on powershell but I feel like they're verbose and hard-to-remember or perhaps just plain different from what I'm used to working with for the last decade or so on OS X/Linux. For example if you need to access an environment variable like Path - on Bash you just use $PATH the same way you have forever. On powershell it's $Env:Path - maybe this makes more sense ("in the current execution environment, access the Path variable") but I had to google it to check and my first instinct was "oh it's something like %PATH% I think..." - which is the old windows cmd.exe way. So maybe the biggest "pro" for the traditional linux command line way is "inertia" - but I'm sure someone else has a much more satisfying answer than mine
- ogrisel 10y agoIf you want to quickly check that your code works on a Linux server, the windows subsystem for linux is quick way to do this without spawning a VM. That does not replace continuous integration on a real Linux host but that might be a good way to do interactive development and debugging of cross-platform code directly on windows.
- gspetr 10y ago> the windows subsystem for linux Which windows versions are we talking? Do they all have equally good support or are previous (Most people are still using Win7) versions crippled in some way?
- y4mi 10y agothe windows subsystem is limited to the latest version of windows 10. actually - scratch that: its limited to the now coming version of windows 10. there are (to my knowledge) no plans to ever port it to any other system. this was stated in one of the earliest interviews about it iirc
- WorldMaker 10y agoFirst stable release of WSL was the Windows 10 Anniversary Update, which has been both the Current Branch and Current Branch for Business, since back in November. (The Creators Update out soon includes updates/enhancements/fixes to it.) It is not expected to be back-ported to Windows 7. (Why would it be?)
- CJefferson 10y agoHonestly, in my opinion not a lot, except many people have years of experience in unix shell, and many programs you will download will have unix shell scripts, but not powershell. On the other hand, remember on the scale of computing, powershell is fairly recent. We used to have batch files and the 'cmd' shell, and they were fairly awful.
- bbotond 10y agoThe main reason I use bash instead of PowerShell on Windows is autocomplete for git [1]. [1]: https://github.com/git/git/blob/master/contrib/completion/git-completion.bash https://github.com/git/git/blob/master/contrib/completion/gi...
- alushta 10y agoI tried both and think the PowerShell one is better: https://github.com/dahlbyk/posh-git https://github.com/dahlbyk/posh-git
- pjmlp 10y agoNot much, other than UNIX kind of workflows. I use Microsoft products since MS-DOS 3.3 and my path into UNIX was via Xenix and DG/UX, before GNU/Linux was a thing. Being a developer doesn't mean using UNIX, rather producing software with whatever tools our employer uses for producing business value. Powershell is much better concept for a CLI, taken from Lisp and Smalltalk REPLs than a pure UNIX shell.
- terminalcommand 10y agoIMHO powershell resembles more smalltalk than lisp. Trying to write powershell scripts without the ISE (Interactive Scripting Environment) is very hard. Also powershell is not suitable to just open and "bash" thigs out at it. For example to download a file, you need to remember the corresponding .net package. Or to list a directory, you use -without the alias- get-child-item etc. I think the verb+noun syntax and the ability to use all .net packages are awesome. But you first need to do your research, find the modules, look up the required parameters, put those in a file etc. In bash, most linux users just "bash" things out, if you don't know something no problem, you just "man" that. Although the same thing could potentially established with powershell through aliases and extra binaries/scripts for utilities like diff/curl, powershell in its nature is a different beast. I really like powershell, writing scripts with the ISE and the object oriented design are really powerful. That's why I think powershell resembles smalltalk rather than lisp. In order to write powershell comfortably and efficiently you need to use its development environment with GUI.
- pjmlp 10y agoI agree with you, just I don't get " powershell resembles more smalltalk than lisp." part. While FOSS Lisp environments are pretty bare bones text CLIs, that is not how Lisp should like since Xerox PARC, TI and Genera days. Sadly Lisp IDEs are all commercial, but the experience is pretty much Smalltalk like, or even better, given that they also AOT to native code.
- terminalcommand 10y agoI was never aware of the existence of a Lisp implementation with an IDE. Now I see that there is. The two lisp books I read (Paul Graham's ANSI Common Lisp and gigamonkey - Practical commmon lisp) always used text editors. Whereas for smalltalk I installed a VM (scratch) that included a GUI. And also even in an old issue(80s?) of Byte magazine dedicated to smalltalk there were extensive toolings with GUI. https://news.ycombinator.com/item?id=7052479 https://news.ycombinator.com/item?id=7052479 "By resembling smalltalk" I wanted to mean that the user needs to interact with a development environment to get the full benefits of powershell. And that this is in its nature. Nevertheless, I stand corrected. I never knew that there were lisp implementations designed to work with an IDE.
- adrianN 10y agoIt's the same shell that runs on your server and the same shell the developers of all the open source tools you might want to use use. Powershell is pretty neat, but bash just has more momentum.
- friendzis 10y agoBash (de facto standard Linux shell) itself is quirky enough to not have any significant advantage over powershell, however, standard GNU utilities have huge momentum with them. Too many tools are built over standard utilities glued together with shell scripts that replacing environment expectations in higher level tools is next to impossible. In my view powershell was not designed as a shell, but more like programming tool specific for Windows administration with a REPL. Powershell looks designed for .NET programmers intending to write small administration scripts and occasionally drop to interactive shell. Bash and other Linux shells are designed for interactive use with programming features bolted on. All this makes bash much better alternative for glue between various tooling, exactly what a developer needs