mkaz.blog

Embracing Windows 10

First off, I am a huge proponent for Linux, it has been my primary OS for many years. One of the first big projects I led was converting ETRADE's production system from Solaris to Unix, running Linux on your production servers was a radical idea back in 2002. I've embraced and been a champion of open source the majority of my career.

Twenty years later, we've come a long way, but still not quite far enough. Linux on the desktop is really good, GNOME is by far my favorite desktop. For me, it is easier to do just about everything in Ubuntu than it is for Mac or Windows, upgrades, installations, simple things like adding a printer are actually simple—though video cards and sleep still have a bit to go.

Unfortunately, there are still companies that have not embraced Linux. The main culprit that effects me is Adobe. There is no open source equivalent to Adobe Lightroom. I've tried them all, I went over a year trying to convince myself that I could use one of these almost equivalent photo tools. If you look at my photo blog, the last year using open source tools led to the biggest drought of photos published.

Adobe Lightroom is good, it helps me view, rate, process, and publish easier than any other tool. I'm stuck with it. So, long story short. I need a Windows or Mac install.

I've grown weary of the cult of the Mac, for many years now their OS has suffered, upgrades take hours, numerous issues occur each time. Plus they continue to make anti-developer changes, from permissions, to antiquated versions, or removing developer tools. They want macOS to be like their phone, and that's not for me.

So that leaves me with Windows 10.

The last few years I've tried off and on trying to embrace Windows. The WSL system is enticing, combining Linux with a desktop people build apps for. However, each iteration of WSL leaves me wanting the real thing. The new WSL2 that is finally coming out of beta now shows good promise, I'll save more on WSL2 for another post. (WSL2 post published)

After the thousandth time bouncing around OS's, trying virtual machines, attempting docker only installs, VMs, and all sorts of wonky setups. I decided to try the unthinkable, fully embracing native Windows, this includes PowerShell as my default terminal — and you know what, it's actually pretty good.

Windows Terminal

First up, one of the biggest problems using Windows 10 previously was your terminal choices. There were numerous mediocre ones with limited support of basic things like UTF-8, or new ones with support were built on Electron and dreadfully slow.

Thankfully, Microsoft has created a modern terminal that works quite well called simply Windows Terminal. It works with both Powershell and WSL, and feels like a normal terminal, even has tabs and a JSON file to config.

PowerShell

PowerShell is quite good, unfortunately I have decades of real Linux and bash experience I'm fighting that makes it much more difficult. Many commands are the same, or aliased to be close. I still type ls -l occasionally which gives an error.

There is an equivalent z script that allows you to jump directories similar to Linux.

Another tool to check out is posh-git, that allows you to customize your shell prompt with git info, quite powerful and maybe even easier to configure than bash.

Like bash, PowerShell is not just a terminal but a language, a much nicer and more thought out language at that, though unfortunately it is quite verbose. Thankfully, you can make command aliases like you do in bash.

When PowerShell starts it will run the profile.ps1 script in ~\Documents\WindowsPowerShell so place your aliases in that file and they will persist in new terminal windows.

I get around using most bash commands as if nothing is different, the one that still trips me up is removing, rm -rf does not work because the Remove-Item command has an ambiguity for f flag.

You need to run rm -r -force your_dir this is an alias for the real command which is Remove-Item -Recurse -Force your_dir

Try out PowerShell, it's not nearly that bad, and would probably be a great shell if history wasn't working against it. Definitely much nicer to write a script in PS than it is bash. Unfortunately, there is 30+ years of bash scripts to contend with, which is a lot of ingrained knowledge.

Development Tools

Git works just fine on the command-line, install the binary package and it even bundles some extra shell binaries that work fine in PowerShell. Place your ssh keys in ~/.ssh/ and it all works as expected.

Windows started integrating OpenSSH tools back in April 2018, so ssh and scp work as expected without requiring any additional thought.

Install the Node binary from nodejs.org and it all works as expected on the command-line. The fun part is you get to see all the projects that assume Mac or Linux environments by embedding bash scripts, shell pipes, and other incompatible parts.

Obviously, Visual Studio Code, developed by Microsoft will work as expected.

Vim and NeoVim both also work just fine in PowerShell; download, install and run as normal.

Most languages and tools all have Windows installs, I've been playing with Rust and the rustup installer works just fine.

Development Environment

The tools end up being the easier part, the more challenging is with all of the individual projects and setting up development environments for them. Projects can make any assumption they want, so you end up being at their mercy to some degree.

Thankfully most projects are now using Docker as a means to get setup and running quickly Even those projects that don't use Docker, you can create your own environment and bootstrap to match what they expect.

Using Docker, also allows you to run tools without installing them across your OS. For example, I run julia using docker run -it --rm julia

For WordPress development, Local by Flywheel is a great way to setup sites. It is basically Docker wrapped in a nice custom made interface to run WordPress sites.

Summary

I've been able to run full Windows 10 environment, using native tools and shell and been equally productive. There are still a couple of projects at my company that use bash for setup and build scripts. I'll ssh into a Linux server I run at home, and will either use VSCode Remote Development, or I'm pretty comfortable with vim.

All in all, I'm pretty happy with Windows 10. I even get the added bonus of my NVIDIA card works great, though I'm not a gamer, but does help for desktop acceleration and apps. Windows 10 is far from perfect—there is still the underbelly of Windows 95/NT lurking behind the scenes—but all-in-all quite usable and my best consumer and developer setup.

For a pure development machine Linux still wins hands-down.