How to do Windows
It’s been a while since I packed my last Windows box with it’s pair of screaming 733 MHz Pentiums into a closet, never to return. The tech landscape has shifted a lot since then: AWS, smart phones, the evolution of JavaScript, the various permutations of data and machine-learning. Well, never say never. Here we are in 2021, the world is turned upside down, and after 15-plus years of Mac and Linux, I’m reluctantly back on Windows.
So, in 2021, how do you—or can you—make Microsoft Windows tolerable? Here’s what I’ve figured out so far.
Just say no
First, don’t switch unless you have to. Expect to lose a week or two setting up, working kinks out, and getting used to a new environment. Also, expect to pay an ongoing tax on your productivity if you switch back and forth between Mac and Windows.
CTOs, VPs of technology, don’t do this to your people. Allow them to choose the platform on which they are most productive. Whatever you gain from standardization will be more than offset by losses in productivity, increased vendor lock-in, and decreased hiring pool.
That said, I really only need 3 things to be productive: a text editor, a terminal, and a browser. After a few weeks, I have these more or less dialed in and it’s starting to feel like a workable development environment.
Keys
Pushing things like typing down into muscle memory frees up space for higher-level thinking. Switching keyboards makes that harder.
While key-bindings are customizable, some friction around keyboard layout is unavoidable. Your choice seems to boil down to remap alt to ctrl and deal with the quirks that induces or just get used to switching and pay the tax.
It took me while to figure out that windows-key + .
brings up a special-characters menu like control + command + space
on MacOS. Apparently, you can’t directly type things like curly-quotes without a numeric keypad.
Here’s more on keyboard remapping:
- How to Remap Your Windows Cut/Copy/Paste to OS X-like Controls
- How To Reconfigure Keyboard By Remapping Keys On Windows 10
Text Editors
This is a bright spot. VS-Code is excellent. JetBrains products are, too. Both work fine on Windows.
Command shell and terminal
In the old days, I used Cygwin to “get that Linux feeling on Windows”. CygWin is still there, but these days, there’s also Windows Subsystem for Linux, aka WSL 2. At one time, you had to install WSL 1, then upgrade to WSL 2. Thankfully, as of 2023, just head on over to the app store. Once you’ve installed WSL and Ubuntu, you’ve got all the GNU-ish and Linux-y tools your grinchy little hacker heart desires. Pull your dot files off GitHub and away you go. I installed OhMyZsh and the powerline font package for an extra layer of nice.
Windows Terminal seems solid. WSL is a great idea, but it has its issues.
See also:
Browser
Microsoft has quite a history with browsers. Internet Explorer won the browser wars and then became epically aweful. What is now called “Legacy Edge” was a failed rewrite.
The new Edge is basically white-labeled Chrome. Perhaps an admission of defeat, but it’s quite simply a decent browser. Seems like a good call.
Say something nice
The desktop switching feature works nicely. You can even label desktops. Why Apple won’t implement named desktops is totally beyond me. People have been asking for a decade.
What the hell am I doing here?
Some Microsoft sales rep did a heck of a job here in Wellington. There seems to have been a large amount of Redmond kool-aide going around at some point. One employee handbook I happened to peruse pledges commitment to Microsoft in the third paragraph.
I overheard a co-worker saying, “you get what you pay for with open source software.” He only trusts products where you can call tech support when they break and it’s their problem to fix it. There’s a sentiment I hadn’t heard in ages.
As Microsoft turned underdog, I’ve found myself rooting for them. The company’s messaging is much improved under Nadela. AWS needs a viable competitor and Google seems like it can’t be bothered. I’d like to see a Microsoft that produces great products that mesh nicely with the non-Windows world.
Misadventures in Windows-land
…I’m just complaining now, preserving my travails for the record.
WSL2 Slowdown / slow networking
I experience a persistent slow-down over time, apparently others have as well. The machine going to sleep and/or coming on and off the VPN seem to make it worse. VS Code takes 10-20 seconds to write a 15k Python file. Rebooting restores snappy performance.
Is this the cure: Speeding up WSL I/O up than 5x fast + saving a lot of battery life & CPU usage?
WSL2 DNS issues
Apparently, WSL2 does some behind-the-scenes hackery to configure /etc/resolv.conf
based on the host OS settings, which can run into problems and cause DNS lookup to fail. You can fall back on manually configuring DNS. My /etc/resolv.conf
looks like this:
nameserver 8.8.8.8
nameserver 1.1.1.1
You may get away with using public DNS servers. Your VPN may require using it’s own, which you might find by doing ipconfig /all
in powershell.
After DNS worked, outgoing SSH connections were failing until the folks at Perimeter 81 gave us this bit of magic:
sudo ifconfig eth0 mtu 1380
…or on versions of Ubuntu later than 18*:
ip link set mtu 1200 eth0
WSL2 clock skew
WSL 2 has had an issue with clock skew. I kept having to reset the clock after sleeping, like so:
sudo hwclock -v -s
It looks like the clock skew issue is fixed. I had this version 5.4.72-microsoft-standard-WSL2
. I upgraded to 5.10.16.3-microsoft-standard-WSL2
. True to form, the installer “.msi” file has some issue requiring a workaround.
BTW, you can check the kernel version, like so:
uname -r
…or in powershell:
wsl --status
Azure DevOps WTF
What could they have been thinking? Look at the order of the breadcrumbs. They put “Pull requests” above the name of the repository, implying that a pull request has repositories inside it. Just weird.