7 ms·
> I like Git Bash because… > I’m more comfortable with bash commands than CMD or PowerShell commands (because I’ve been using Bourne shell (sh) and friends for
by delta_p_delta_x 2y ago
> I like Git Bash because…
> I’m more comfortable with bash commands than CMD or PowerShell commands (because I’ve been using Bourne shell (sh) and friends for more than 30 years).
This is the only argument I'm willing to accept, and honestly it's the only argument the writer needs, really: un-learning 30 years of experience to use something else even if the latter is objectively superior, would be a pain in the neck for anyone.
That being said I believe that seriously attempting to use the native tools would help the author understand Windows at a more fundamental level.
Also, this does raise a few questions, though—if the writer has been using UNIX shells for that long, why are they using Windows at all? As I commented elsewhere, why shoehorn the whole set of UNIX core utilities and binary utilities onto Windows when the latter comes with its own shell, command-line utilities, and management tools? More importantly, the author going by the rest of their posts (assuming it was the same author) doesn't strike me as the type (i.e. normie, for lack of a better word) to use Windows as a daily driver, but they seem to use it all the same. Therefore, why not an OS where these utilities feel more native and more useful, like Linux or one of the BSDs?
In contrast to the author I've been using and programming almost nothing but Windows (with a brief stint on Linux in university and now at work, but only for work), and on Windows I use PowerShell and if I really need to, CMD.exe (good riddance). As far as compilation goes, I use Visual Studio with MSVC and Clang-Cl, because they are the only complete development environment for Windows—all the others (MinGW, Cygwin, MSYS2) are incomplete or worse in some way, or make life harder than necessary in some way.
> I have experience using Windows PowerShell (powershell.exe), but do not yet have experience using the cross- platform PowerShell Core (pwsh).
For the record, functionality between powershell.exe and pwsh.exe is almost identical, with some minor differences[1]. Additionally they differ in the .NET runtime they were written against (.NET Framework 4.8 for powershell.exe, and .NET 7 and later for pwsh.exe).
[1]: https://learn.microsoft.com/en-gb/powershell/scripting/whats-new/differences-from-windows-powershell?view=powershell-7.4 https://learn.microsoft.com/en-gb/powershell/scripting/whats...
- jaaron 2y ago> why are they using Windows at all? In my case: - I had 10+ years of experience in linux/unix development - Career change to AAA game development which is predominantly Windows based - Day to day do Unreal C++ developing in Windows with Windows toolchains - Still use WSL (and thus bash) for everything else, including DevOps related work, cloud/container development work, and personal notetaking/productivity via emacs+org-mode. So, some of us have reasons to co-exist in multiple OS's. I tend to write up scripts in Python if I can so that there's at least a chance that I can run them in both Windows + Unix environments.
- jamesfinlayson 2y agoI feel similarly - I first learned about the shell with Linux and all my career has been with Linux, but at home I use Windows. I am making an effort to be better at PowerShell but if I just want to do something quickly, I already know how to do it with bash and I just want to get on with my day.
- heavyset_go 2y ago> Also, this does raise a few questions, though—if the writer has been using UNIX shells for that long, why are they using Windows at all? As I commented elsewhere, why shoehorn the whole set of UNIX core utilities and binary utilities onto Windows when the latter comes with its own shell, command-line utilities, and management tools? I'm a Linux user and developer who writes software targeting Windows. Tools like Git Bash and MSYS2 let me write one set of build scripts that work across Windows, macOS and Linux, because all of the tools exist on the three platforms. I don't have a need to understand Windows on a more fundamental level, nor do I want to. I just want to meet my users where they are at, which is Windows/macOS/Linux.
- delta_p_delta_x 2y agoFair point. I've edited my comment to show my impression that the author uses Windows as a daily driver, rather than merely 'for work', which I think makes the cause for my confusion a little clearer.
- wilsonnb3 2y ago> Tools like Git Bash and MSYS2 let me write one set of build scripts that work across Windows, macOS and Linux, because all of the tools exist on the three platforms. Powershell is cross platform too these days, which makes this kind of a moot point.
- metadat 2y agoPowershell had potential, but it didn't pan out. It's annoying and very challenging to remember all the one-off flags. With bash, you only need to learn 10 or 20 short commands and a few flag variants, over a gently long period of time. Then you're all set for 97% of cases likely to be encountered.
- ants_everywhere 2y agoI just wrote a two line bash script to process some large csv files that Python/Pandas were taking far too long to process [0]. A lot of people (myself included) tend to underestimate the power of the heavily optimized GNU utilities and the ability to manipulate them with bash. [0] It was two lines for readability. It could have easily been a single line.
- scintill76 2y ago> if the writer has been using UNIX shells for that long, why are they using Windows at all? Maybe the IT department policies force them to. At least that's why I use Windows but do most of my development in an ssh terminal to a Linux system.
- chiefalchemist 2y agoAt this point, this should be the industry standard. "Local" should be whatever you can SSH into. You can get as much hardware as you need, and you don't have to worry about anything private (i.e., customer information) and/or proprietary being on your lost / stolen laptop.
- kccqzy 2y agoPerhaps the company is otherwise all in on Microsoft's ecosystem. Perhaps they use Outlook, Word, Excel and similar apps where the Linux version doesn't exist and the Mac version is an afterthought. So IT forces everyone to have a Windows system, and then give only the developers a separate Linux machine.
- grimgrin 2y agowhat about https://github.com/microsoft/terminal https://github.com/microsoft/terminal you use that too right? you better!
- delta_p_delta_x 2y agoWithout question. I was so glad when 22H2 allowed users to change the default console host to Terminal; it was the single biggest reason why I decided to stay on Windows 10.
- rcarmo 2y agoI find this interesting because, well, I’ve used bash on Windows for _ages_ (literally before the EMWACs toolkit came out for NT 4.0, and I spent many, many years running Cygwin). I have to use PowerShell, but since it essentially wraps .NET services I very much prefer to either write C# (and have vastly more maintainable and testable code) or, when removing, invoke the APIs using a Unix scripting language. And these days I can write nice “portable” (ok, retargetable) binaries inside WSL and output a Windows build if I need to…
- wwweston 2y ago> if the writer has been using UNIX shells for that long, why are they using Windows at all? Desktop applications would probably be the usual reason. It's all well and good if your application needs are covered by open source, but there's a fair bit of software with value add beyond open source that's never received a Linux version and WINE doesn't support well enough. Of course, as you say, then you have the problem of the shortcomings of various *nix environments for Windows. MacOS can be a great solution... if your app still runs under MacOS (currently I'm trying to figure out how to get Fireworks to run under a minimal windows or mojave VM).
- jiggawatts 2y ago“When in Rome, do as the Romans do.” I don’t respect the attitude of doing whatever you’ve always done, even when working in a wildly different environment. Imagine how Linux people would react if there were endless blog posts about using VB6 scripts on Linux by running them under WINE because “that’s what feels familiar.” Sure, for a lark that’s hilarious, but not if you share your work with anyone else for any reason, even open source.
- delta_p_delta_x 2y ago> Imagine how Linux people would react if there were endless blog posts about using VB6 scripts on Linux by running them under WINE because “that’s what feels familiar.” Heh, that would be hilarious. In fact someone should come up with a Linux distribution that uses NTFS, PowerShell, comes with .NET, WINE, and no coreutils and blog about it.
- jiggawatts 2y agoHah… I just realised that all of the pieces are now there for a “Windows” distro that uses the Linux kernel instead of the NT kernel.
- makeitdouble 2y ago> “When in Rome, do as the Romans do.” Parent is obviously choosing the "Veni Vidi Vici" side of the coin. If they can pull it off, why not ? It's their machine after all.
- devnullbrain 2y ago>Imagine how Linux people would react if there were endless blog posts about using VB6 scripts on Linux by running them under WINE because “that’s what feels familiar.” Alternatively, we could ask why the POSIX-sphere produces enough power users impassioned to, interested in and capable of enabling their pet projects on a closed and hostile platform for blog posts like the OP's but the reverse does not.
- hnlmorg 2y ago> un-learning 30 years of experience to use something else even if the latter is objectively superior, would be a pain in the neck for anyone. It’s “subjectively superior”. If there’s one thing I can’t stand in IT, it’s people who think their personal preferences are equivalent to impartial facts. You disagreeing with the author’s reasoning is evidence of just how subjective this topic is.
- delta_p_delta_x 2y agoThat was poor wording on my part—I should have used the subjunctive mood and written '… if the latter were objectively superior …'.
- hnlmorg 2y agoNot just poor wording but I think you misunderstood the authors context too. Some of his comments were comparing git bash to other POSIX layers like WSL, rather than Bash vs PowerShell.
- delta_p_delta_x 2y ago> I think you misunderstood the authors context too This I did not. The post was about Git Bash as a command-line shell for Windows and everything it entailed, I understood that and that's why I wrote the paragraph that followed. I was limiting the scope of my comment to the author's familiarity on Bash versus CMD or PowerShell because I considered that the cornerstone argument of the entire post. Everything else that the author mentions is expected by default in a *sh-type shell on a Unix-like OS; there's nothing special there. People wouldn't blog about being able to use `grep`, `ls`, etc on Linux; it's just everyday business.
- hnlmorg 2y ago> > I think you misunderstood the authors context too > This I did not. The post was about Git Bash as a command-line shell for Windows and everything it entailed, I understood that and that's why I wrote the paragraph that followed. I literally just said he wasn’t just comparing Git Bash with Powershell though. So you can’t have understood their context if you took Powershell to be the “cornerstone”. It’s a bit of a muddled blog because he is constantly switching focus between “Git Bash” (the package / distribution; whatever term you want to describe it as) and Bash.exe (the shell). There are a lot of the comparisons are with things like WSL, for example when he discusses the underlying file system. And when he talks about the ease of installing and keeping things up to date. None of that was directed at Powershell specifically, nor even at all.
- addicted 2y agoI used bash in college and then didn’t use it for around 5 years. And then I used powershell. And bash is still a lot better as a shell language. Powershell commands are long and annoying. If you remember all the aliases (most of which are annoyingly bash commands but hardly behave that way) then the parameters are long and annoying. Stringing commands together requires too much API digging because objects mean you need to run a variety of incantations on the results to know what members you need to pull out and what data format they have, etc. in Bash it’s always strings and if you know a couple of useful string manipulation commands such as cut, that you probably know anyways for other reasons, you can get by with stringing most commands fairly trivially. Powershell OTOH is a lot better when I’m trying to write an actual reusable script. But at that point why wouldn’t I just use something like Python anyways (or if it will be associated with a front end repo I will often just use nodejs since it’s definitely installed). Python has much more usable comparison, control flow, etc operators, much bigger libraries, better multi OS compatibility etc. The only advantage really is using powershell commands/applications, so sometimes I will write my scripts in Powershell. But in Linux I will also sometimes write my scripts in bash for the same reason, so it’s not really an advantage inherent to powershell, but the fact that it’s the “standard” of the OS. I do like Powershell, but the problem with it is that it tried to be both a great scripting language and a great shell language, but the things that make it a good scripting language, such as verbose naming, objects, etc make it a worse shell language than shell languages designed to be shell languages first, and the things that it does to make it a useable shell language, makes it a worse scripting language than other scripting languages. On average it may be the best language across all environments and use cases. The problem is that for any specific environment and use case it’s rarely one of the better languages.
- tdeck 2y agoThis is a very succinct dissection of the problems but I will add one more: PowerShell's frustrating behavior where any return value of a function call is part of the enclosing function's return value if not explicitly swallowed. I understand what they were going for by analogy with other shells here, but in my opinion in a language like PowerShell (with actual return values) this is unintuitive and makes it really easy to introduce bugs. The whole object pipeline thing they were going for feels like an evolutionary dead end that we shouldn't be saddled with.
- drums8787 2y agoI make a living writing software that's hosted on Windows. I've never felt as comfortable with the command line options on Windows as I do with macos/Linux. Git bash with vim was such a relief. It's an idiosyncratic mix of ergonomics and habit probably. I don't really care since I get the job done efficiently (more so than a lot of "Windows natives" I observe).
- ethagnawl 2y agoIn my experience, it really does come down to the ergonomics: the cursor, the casing, the forward slashes, whatever key combo is required to paste (shift+insert?). I'm sure PowerShell and friends are great but it's enough of a shift to not be worth the learning curve if it's an environment you're just dipping into to do the bare minimum required to make something work.
- fsckboy 2y ago>if the writer has been using UNIX shells for that long, why are they using MSWindows at all? MSwindows is posix, why not? windows supports tons of software that is not available on unix. People have to work with other people, spouses, university colleagues, whoever, maybe those people use MSWindows
- ethagnawl 2y ago> why are they using Windows at all? I'm a back-end developer/DevOps/Linux sysadmin who runs a small consultancy. I've been brought into a few Windows projects -- primarily on-prem/interactive installations. The past few occasions because the client was using Windows because the FE was being built using TouchDesigner. (Not sure it's still Windows-only but it was previously.) So, it happens. Clients have many reasons for running Windows and depending on the project and its needs, I may accept the requirement or not. To use a recent couple of examples, if I can use GitBash, Docker, WSL and Python locally, then I'll probably take it on. If they're set on using PowerShell, C# and Azure, I'm probably out. That all being said, if the project is interesting or high profile enough, I'll jump through whatever hoops are put in front of me.
- sytelus 2y agoPowerShell should be taught in university as example of how poorly designed system devoid of taste and aesthetic looks like. It's an ugly monstrosity that makes me puke every time I try to use it. The only reason some people might like it is because they have been tortured by Windows defaults for many years and finally they got used to this utter mediocracy.
- delta_p_delta_x 2y agoIt'd be good if you could actually justify why you think PowerShell is inferior to UNIX shells, instead of going on an impassioned but unsubstantiated rant.
- keithnz 2y agoI think powershell is actually really well designed. Some of the syntax leaves a bit to be desired, but other than that I think it's really good. What do you think is poorly designed?
- devnullbrain 2y ago> Some of the syntax leaves a bit to be desired That's quite poor design for a shell! It's like saying an OS is well designed except the mouse and keyboard input leaves a bit to be desired - because they were designed for scripting first and users second.
- keithnz 2y agoNothing like that, It's Mostly its fine, and certainly no worse than bash.
- throwaway2037 2y agoYears ago, I had a teammate that was always pushing me to try Cygwin. While I love a UNIX shell, Cygwin just felt... weird. The whole paths thing really turned me off. What pushed me to try it? He said to me: Why bother learning two shells (UNIX + DOS), when you can just use one (UNIX) everywhere? I couldn't find a good argument against it. I tried Cygwin, and, eventually (never?) got over the weirdness of paths.
- irunmyownemail 2y ago"shoehorn" Git Bash is an elegant solution that brings some of the awesome Gnu utilities and does it on Windows terms and effortlessly. No shoehorn needed. WSL is handy (those times I'm forced to use Windows - which is still better than when I'm forced to use Mac) but you have to remember the whole time you're in WSL, you're in Linux proper and all things work as Linux, generally, sort of. Git Bash is the power of Gnu right on Windows.
- devnullbrain 2y agoWSL also adds yet another restart loop to the already lengthy process of turning a fresh machine into a workable Windows development station.
- CoolCold 2y agoMy take here - when working with stable system, changing OS once a several years (last one was when changing laptops basically, so 4+ years in my case), I don't care much on _single_ reboots. For those who tirelessly do distrohopping, things may look different of course.
- beart 2y agoThe minor differences can be a major issue. Powershell 7 still doesn't come installed on any windows system as far as I know, so you are better off targeting Powershell 5, and unable to take advantage of the features offered by 7.
- devnullbrain 2y ago>Also, this does raise a few questions, though—if the writer has been using UNIX shells for that long, why are they using Windows at all? An answer that I haven't seen offered yet: because Microsoft spend billions trying to gain and retain developer marketshare