Say you are a developer or power user. Should you use a Mac or a PC?
Pricetag aside, "use a Mac" has been a dominant answer ever since Apple released Mac OS X in 2001. Macs come with tools like cURL and Python already pre-installed, with Xcode and additional software available to fill in the blanks. Because macOS is Unix-based, developers can deploy their macOS shell scripts to Linux web servers verbatim so long as they have accounted for differences in case-sensitivity. That saves times and brings peace of mind.
And one more thing: Mac users can still install Windows locally with Boot Camp if necessary. They enjoy high-quality hardware that many might even call sexy, thanks in no small part to Apple's marketing machine. Macs allow developers to get up and running in a stable and clean environment quickly and focus on coding.
On the other hand, PCs are cheaper and have greater mindshare due to their greater market penetration. More people are more familiar with using a PC than a Mac. PCs also provide a wider selection of software. If you already own a PC for gaming, business, and everyday productivity, why buy another computer just to write code on a Mac? Is the price tag too high, especially when today's PCs can run a Linux distribution locally?
PCs are more tweakable and customizable than Macs, which pleases the hobbyist within. And no matter your operation system, you can still install and run well-regarded cross-platform code editors such as Visual Studio Code and Atom.
Into this age-old debate steps The Windows Subsystem for Linux (WSL). Released in 2016, WSL allows PC users to run a Linux distribution more or less natively within a Windows environment. Interest has been growing over time.
How does the Windows Subsystem for Linux tilt the PC versus Mac debate? I have been using WSL on my Windows 10 PC for the past month. Here is what I have learned.
Getting started is painless.
Step one is to enable the Windows Subsystem for Linux. Sign into your Windows 10 PC, go to Turn Windows features on or off in the Control Panel, check the Windows Subsystem for Linux checkbox, click OK, and you are done.
Step two is to install your Linux distribution of choice. Open the Microsoft Store desktop application, search for Linux, click Get the apps, and choose a Linux distribution to install.
Ubuntu is the most popular choice, but do not feel limited. You can install as many of these Linux distributions as you like, including different versions of the same distribution (e.g. Ubuntu 16.04 and 18.04), and they will not conflict with each other. Uninstalling a distribution is costless: all it takes is one click in the Control Panel, as if it were any other installed Windows application.
Useful command line functionality, right away.
After installing and opening your Linux distribution, the Bash shell appears. On Ubuntu, the
lsb_release -a command will let you confirm which version you are running. In this case, we are running Ubuntu 16.04 LTS.
The Bash shell will be familiar territory for seasoned Linux and Unix users. Everything you might expect from a Linux distribution is here except perhaps graphics, for which there are only unofficial/unsupported workarounds.
If you are new to the Bash shell, welcome! The functionality is 100% command-based. Here are several commands that will work immediately:
lsb_release -a - Check your version.
echo "hello world" - Write "hello world" to the Bash shell.
sudo apt update && sudo apt upgrade - Update and upgrade your software.
sudo apt autoremove - Automatically remove orphaned software components.
sudo apt install python - Install Python.
sudo apt purge python - Uninstall Python.
ssh USERNAME@IP_ADDRESS - SSH into your remote server. With this command, there is no more need for PuTTY.
curl [URL] - Scrape the HTML from [URL]. Be careful with this one - please note that many websites explicitly disallow scraping in their terms of service. cURL can also be used to call an API.
cd /mnt/c && ls -l - Navigate to your C: drive and print the list of files and folders there.
cd / && ls -l - Navigate to your Ubuntu installation's root directory and print the list of files and folders there.
tail /var/log/dpkg.log - Read the most recent lines of a log file.
nano /var/log/dpkg.log - Open a text file in the text editor nano.
ifconfig - Check your Internet connections.
exit - Exit Ubuntu.
If you are new to development, you may decide to configure your installation into a local development environment, which is probably the main reason why Microsoft developed the Windows Subsystem for Linux in the first place.
For example, if you decide to start a blog, you may wish to install a local instance of Ghost blogging software on Ubuntu, develop your materials locally, and deploy them to a virtual private server (VPS) when you felt ready. For inspiration, consider checking out resources from web hosting providers such as Linode or Digital Ocean.
Tiny resource usage.
Both Ubuntu 16.04 and Ubuntu 18.04 start in less than a second and use negligible RAM, in our case less than 3 MB.
The Windows Subsystem for Linux is probably the most memory-efficient way to run Linux on Windows. The (very small!) numbers quoted above may not include 100% of the additional resources consumed by the operating system due to WSL being enabled. That said, WSL feels zippy, and other Linux-on-Windows options such as a virtual machine or Docker add substantial memory-consuming overhead.
The Windows Subsystem for Linux is is also storage-efficient, especially compared to solutions like dual-booting that require you to partition your hard drive. Linux on WSL is in the class of solutions that allow you to conserve the 10 GB (or greater) of hard drive space that would otherwise be dedicated to your Linux partitions.
What about ease of use?
The Windows Subsystem for Linux gives PC users easier access to a Linux environment than ever before. If you use Windows and want to add Linux environment that you can manipulate via the command line, look no further. WSL will give it to you, and it will be clean, fast, and flexible.
The Windows Subsystem for Linux really only lacks one thing: graphics. Options to run graphical applications in WSL require unofficial/unsupported workarounds. The situation seems similar for Docker, e.g. this.
To run a supported Linux desktop environment with graphics on a PC, the main options are still run a virtual machine or dual-boot. A virtual machine is terrific if you need to switch quickly between Windows and a full Linux distribution. Dual-booting from your hard drive will allow you to run Linux on your computer with maximum efficiency, if that is your goal. The downsides are that it will take extra time to switch between Windows and Linux, you will lose hard drive space to your Linux partitions, and if you ever change your mind you will have to deal with the minor hassle of uninstalling a Linux bootloader. Still, both options will get you there.
If you really want graphics but are not sure you are ready for a virtual machine or a dual-boot setup, you can always start with a Linux DVD or USB stick. Ubuntu has posted a brief tutorial for creating a bootable USB sitck. If you have a PC, a broadband Internet connection, and a USB stick, you should be able to make one in 30 minutes or less.
For years, it has been possible to install and run Linux on your PC. The Windows Subsystem for Linux makes that easier, faster, and more reversible than ever before.
The Windows Subsystem for Linux allows PC-based developers and power users to replace a plethora of tools (VMs, dual-boot setups, SSH clients, SFTP clients) with a single, faster, simpler solution. It also lowers the barriers to becoming a developer. How many more creative PC users will become developers and digital creators now that Linux, the operating system running the majority of the world's web servers, is now a few easy clicks away?
The Windows Subsystem for Linux clearly makes PCs more enticing for developers and power users. It does not resolve the PC versus Mac debate - probably nothing can do that. But it is a positive step for PC fans, developers, and power users everywhere.