2021 - The Year Windows Became a First Class Python Development Environment

[06/08/2021 Update: Added a bit about Windows Terminal. Dunno how I forgot that the first time around!]

As I've written about previously and elsewhere, I felt so badly burned by Apple's laptop hardware design decisions of a few years ago that I've rather fallen out of love with that platform for my personal work. The latest hardware is much better, but I feel like the message has been sent and received, so I'm not rushing back any time soon.

My first choice was the Linux desktop, and after months of struggling, instability and accessibility issues I'll admit I've been looking for stable, solid alternatives that are also powerful enough to get the job done and maybe even have something new to offer. As an old dog, sometimes it's really nice to be taught some new tricks!

If you've tangoed with Windows in the past, and found yourself struggling against its rather byzantine UI, I'd urge you to read on and see if maybe it's not time for another careful look.

Since choosing the right tools is all about your unique set of needs, I'll use those as categories to drive the discussion and showcase how Windows is doing a great job of satisfying them.

In The Beginning, There Was The Command Line!

One of the things that first drew me to UNIX decades ago was the shell. The ability to get pretty much ANYTHING I needed done by typing a few commands, and to create incredibly powerful mechanisms by stringing them together is downright intoxicating.

I still love me some Bourne shell, it's just as powerful today as it was decades ago. However Windows Powershell has some incredibly powerful paradigms of its own that are worth looking into.

In addition to things like object pipelines and desired state configuration that the UNIX shell simply can't do, modern Powershell has creature comforts like Oh My Posh that make for a very comfortable work environment. Here's a screenshot of mine:

My Oh My Posh Prompt

You can see that I get all kinds of nice status like exit code of last command, current git branch, current Python version and virtual environment, etc.

While Powershell is indeed a totally different beast from the UNIX shell I'm used to, its built in help for every command and understandable syntax make the learning curve feel rather shallow indeed.

Another gripe most UNIX users have when coming to Windows is that everything requires mousing around and futzing with a GUI, and it can feel like you're trapped in an endless series of installer screens to get even your basic working tools installed. Modern Windows obviates all that with winget a full fat package manager with tons of common applications already in there. Just winget install git and you're off to the races :)

Before The Command Line, There Was The Terminal

As anyone who's worked with Windows for a long time could tell you, in the old days, the Windows Console was pretty primitive. You were basically dealing with MS-DOS CMD.EXE with the barest modicum of window dressing. Needless to say, this is 2021 and that's just not cutting it.

Thankfully, there is a superlative alternative that's really come into its own in 2021 - Windows Terminal. Finally all the features anyone who's been working in the UNIX world have come to expect over the last 30 years are available on Windows as well. Multiple tabs, excellent terminal emulation, great theming and color support, and the ability to seamlessly handle different shells per tab. I regularly keep a Powershell and a WSL tab open for my work.

If you've ever struggled along with the old CMD.EXE, fighting for every cut, paste or insert, this really is a game changer.

I Hate Meeces To Pieces! (Really, Don't Make Me Use the Mouse!)

As someone who's partially blind and has fine and gross motor impairment, using the standard Windows Icons Mice and Pointers user interface is downright agonizing. I need to be able to launch apps with just a few keystrokes. On the Mac, Alfred fulfills this role admirably and adds a whole host of next level productivity power ups in addition to keyboard app launching.

A very recent addition on the Windows side that seems equally powerful and easy is Microsoft Powertoys Powertoys Run feature. I can launch apps, bind keys to actions, and access system functions like sleep, restart and the like all 100% from the keyboard. Nice!

Another Powertoys addition that's frosting my Pop-tarts is Powertoys Keyboard Manager which allows me to remaps the dread CAPS LOCK key to Ctrl so it's right next to my pinky as God Intended :)

This simple enhanment has been impossible with Windows forever without resorting to more drastic measures, so having it work pretty much out of box now is super sweet.

Python - It Takes a Cast of Thousands to Raise a Platform

If you'd uttered the words "Python" and "Windows" in the same sentence a few years back, the average Pythonista would have rolled their eyes or groaned and then proceeded to tell you a war story about how they had to spend weeks trying to get some critical module or other working.

Those days are just straight up gone. Microsoft and the Python community at large have poured countless engineer hours into making the Python ecosystem a truly first class experience under Windows. Virtual environments, poetry, and even tools for installing and managing command line scripts that integrate with the shell like pipx work just great under Powershell on Windows.

And if by chance you're coding something up that's native UNIX to its very core, Windows *still has you covered. Cue the Windows Subsystem for Linux!

WSL - I See Penguins!

With the avent of WSL2 and most recently WSL-g you really do have everything you need to seamlessly build, debug and run Linux programs on Windows, including those that require X/Wayland GUI support or sound.

It's not just some kind of compatibility shim, it's an actual Linux kernel running in Windows. The integration is so complete these days that you can run things like Docker within WSL successfully. That's a really big deal!

Also, most of the popular mainstream development tools like Pycharm and Visual Studio Code have superlative support for deploying to and debugging in WSL built in.

The amount and quality of work Microsoft has put into this is truly impressive. And unlike the Mac, you're not actually using some oddball FreeBSD user space running atop the Mach microkernel, you're running 100% Linux. It's turtles all the way down.

I Go Where The Innovation Is & Use What Works

As a technologist, I'm proud of the success I've had in sniffing out pockets of high velocity, high value innovation in the technology landscape.

Years ago, I was running Linux when many people were either using DOS, pre OSX MacOS or super expensive prorietary vendor workstations like Sun's Sparc. Being able to have an honest to god UNIX environment on commodity hardware was like Prometheus's gift of fire to the mortals. It really was that big a deal.

I still think the Linux desktop has incredible potential, but for me the obstacles imposed by my disabilities and the lack of accessibility features can be a real buzz and productivity killer.

So here I am embracing a desktop that works, with an ecosystem that works and a rather large well heeled company pouring resources into bar raising and innovation.

I look forward to exploring and leveraging the incredible potential this platform represents. Stay tuned for more posts as I go!

Plus ça change, plus c'est la même chose

I was recently in an online discussion about whether or not technologists should use "managed services" like the one I work for.




One gent essentially claimed that the move towards cloud and managed services represented an end game for our industry, and that we'd automate ourselves out of a job. This is what I said:

Will there be job reductions and resultant economic pain as a result of the move away from the data center and towards more cloud/managed services? Hell yes there will be!

Those who want to work in this business will find ways to adapt and continue to add value.

I’ve been working in technology for about 32 years. This doesn’t make me magical or omniscient or even smart but what it does make me is a witness to several waves of seismic change.

I came into the job market in the early 90s when DEC was imploding, PCs were ascendant, and the large expensive workstations vendors were dead companies walking but didn’t realize it yet.

Everyone thought the world would end and we’d all be out of work too.

Will it be hard? Yes. Will there be a lot of people who can’t or don’t want to adapt and will be left behind? Undoubtedly. Is that bad? Yes. However it’s the way our industry works and has since its inception.

We are all turning the crank that drives the flywheel of increased automation, whether we administer our own database clusters or not. The move to managed and cloud definitely represents a notable pinch point, and we’ll see how painful the transition will be, but it’s one paradigm shift in an industry that creates paradigm shifts for a living.

I’ve actually thought for a while that in the longer term, as compute at scale becomes quite a bit smaller and even cheaper, we could see a move back away from cloud because when you can host your company’s compute cluster in a cube the size of a printer and we have algorithms that can encode and enact services at scale in an operationally safe way, the value cloud adds will dwindle.

I love my job, and I love this industry, and plan to continue playing in this pool until I die, whether someone’s willing to pay me for it or not.

I assert that the constant negativity many of us exhibit is neither necessary nor desirable and represents a kind of immaturity that we will eventually grow out of as our industry continues to mainstream.

We’ll see.

The Eternal Novice Trap

Introduction

It was the dawn of a new century in the tech world. We'd just survived the great Y2K scare which, for many of us, turned out to be nothing. I spent a memorably pleasant Y2K eve playing board games and sipping champagne at my company's East Cambridge office, enjoying the company of my co-workers. I felt like I was on top of the world.

Right around that time I encountered a book that would change the way I thought about computing. It contained a huge amount of overall incredibly positive and helpful advice. That book was The Pragmatic Programmer.

The Trap is Set

This book contains innumerable bits of incredibly useful advice. The pearls contained within its pages will help you build a successful career as a technology professional.

But I write this in the hope that you won't misinterpret one particular bit of advice like I unintentionally did. In some ways it hurt my career. Thankfully I became aware of it a few years back and am now headed in the right direction.

Here's the advice I used to hamstring myself:

Learn at least one new language every year. Different languages solve the same problems in different ways. By learning several different approaches, you can help broaden your thinking and avoid getting stuck in a rut.

The Pragmatic Programmer, 2nd edition

This is superb advice for its time, when the majority of programmers spent their days coding away in a single language or two.

It's superb advice to this day for that kind of person. If you've spent years coding in Python, why not try your hand at something with a radically different paradigm? By doing so you'll learn new ways of solving problems.

But zooming back to post Y2K me, that picture didn't fit me at all. I'd started out as a sysadmin, learning a huge amount about the care and feeding of UNIX based systems. I'd done some simple scripting to automate administrative tasks, but nothing at all complex or strenuous. A little bit of shell, some Perl, and I had things humming along just great.

Only I took the advice literally, despite my total lack of mastery of any programming language. With wild abandon, I threw myself into every new programming language I encountered..

The Bright, Shiny, Infinite Rabbit Hole

I played with countless languages, FORTH, a myriad of LISPs. You name it, I played with it. If there was a new hot language on the scene you can bet I'd be downloading it and figuring out how to write Hello, World and a few other toy examples.

But that's as far as it went, because, if I'm honest with myself, playing with new toys doesn't feel like work. It's a shot of dopamine. It feels really good in the moment. You feel accomplished because now you can talk about $LANGUAGE along with the rest of the cool kids who are exploring it.

There are also external reinforcements for this behavior. By being able to talk the talk, you can appear smarter than you are. You can probably even answer surface level questions in job interviews which can, in the short term, help your career.

But not unlike living on sugar and caffeine, that short term buzz will wear off, leaving you feeling empty and, ultimately, like the emperor walking around with no clothes. You can talk the talk like a champ, and be up with the latest buzz, but in some corner of your mind you may recognize that your basic skills are fundamentally lacking.

Brush Your Teeth, Eat Your Veggies, Get Sleep & Exercise

Thankfully, the fix is at least conceptually easy. Just stop doing that :) Pick a language that will become your daily driver, and focus on building your core skills using that language.

Build deep, featureful applications. Learn and exercise your skills using the full breadth of your language's ecosystem, and solve real problems using your language of choice.

For me, that language is Python. That's an easy choice because my day job is building infrastructure for a major cloud vendor and 90%+ of our tooling is written in Python. For the last few years I've promised myself to not learn any new programming languages until I become at least a Journeyman with Python.

You may find, as I did, that this is easier in concept than in practice. You may need some structure to help you achieve this goal. Everyone is different, so this isn't a one size fits all suggestion. I'll share some resources that may help.

Resources to Help Sharpen Your Tools

These days there is an embarrassment of riches out there, free for the taking to anyone with a computer and an internet connection to leverage. I'm just going to cover a few that I've found particularly helpful.

100 Days of Code with Python

If you're like me, having a free form set of exercises can be good, but adding some structure with definite time constraints and deadlines, even if you set them yourself, can be immensely helpful. This course was pretty much ideal for my needs. The idea is that you commit code every day for 100 days. This course uses that framework to take you on a guided smorgasbord tour of the incredibly rich Python ecosystem. The course introduces a particular topic or module and then has you build an interesting near real world application with it. I learned so much from this course that it alone has been a real boost to my career.

Completing a course like this can be a daunting task, especially while working full time. However I found the results are well worth the effort. Hopefully you can find something similar for your language of choice.

Exercism

Exercism is an incredible resource regardless of the programming language you work in. It's not just a set of practice exercises, but a community of people who'll help review your code and provide mentorship.

Project Euler

These are language agnostic problem sets that will stretch your skills and force you to really exercise your problem solving skills. I myself have only scratched the surface with these, and plan to delve deeper in the future.

Parting Thoughts

I hope you'll find value in what I wrote here. I wish I'd had this article earlier on in my career. Maybe I can help someone avoid falling into the trap I did. To sum up:

  • Do learn new programming languages and paradigms, but learn them from a place of confidence and mastery with your primary tool of choice.

  • Don't fall for the trap of perpetually chasing after the bright shiny thing that's hot right now. Recognize that what's new isn't necessarily better. Take what will meaningfully help you advance your career and let the rest flow by. There'll always be more tomorrow.

  • Do keep having fun! You'll learn more quickly and retain more if you're finding enjoyment in what you do. Sometimes it means looking at things a little differently, but often that open mindedness can pay off.