Using Linux as a Fulltime Drupal Developer

Posted on Sun, 8/25/2019
7 minutes read

I'm a full time Drupal developer at Code Koalas a mostly Drupal shop based out of Kansas City, and I use Linux as my full time desktop environment. I started playing with Linux as early as 2008 when I download Ubuntu 8.04 Hardy Heron to get away from Windows Vista on my desktop computer that wasn't good enough to properly run Vista. I had also installed it on some old laptops for fun or friends and obviously had and used many Linux servers for work and fun but it never stuck for my desktop until 2017 when I installed Arch Linux on my work laptop a 2015 MacBook Pro. No this isn't simply a "I use Arch BTW" post, though I do use Arch and suggest that or Manjaro for people over Ubuntu for reasons, I hope to show the reasons I choose Linux in the first place and why it's still what I use today.

A Better Window Manager

On Mac windows just float wherever they like, and though I am a fan of their multiple spaces and swiping between them there is always just a mess of windows everywhere. For work I at a minimum always have at least have the following open; Firefox, Slack, a terminal, and PHPStorm. In that I might have multiple tabs and windows of both Firefox and the terminal open. So I'm at a minimum of four windows but probably more like six plus. I don't like using Apple's full screen mode (not sure why, I'm just picky) but my programs are pretty much always full screened. So I was having to use gestures all the time swiping every which way to get to the window I wasted to keep working.

I started using Phoenix which is an i3 like Window manager for Mac to give you keyboard shortcuts to move windows and make them sticky, it worked but wasn't exactly what I needed. I didn't want something like i3 that is a hack on top of Mac's window manager I just wanted i3.

So Why i3?

Mostly I decided I needed a Tiling Window Manager. A Tiling Window Manager is a window manager with an organization of the screen into mutually non-overlapping frames, as opposed to the more popular approach of coordinate-based stacking of overlapping objects. That means that windows never overlap each other, they all get their own place on the screen in a nice orderly way. I choose i3 over some of the other window managers because I knew someone with that and they were willing to share their config with me.

With i3 I was now able to press a command to open Rofi and open any program I wanted (Think Macs Spotlight), press a key combination to move a window to a different screen or workspace, have windows always fall into the place I expected them to, and press a key combination to move workspaces. Now I can work mostly with my hands staying on my keyboard and I don't have to click around all day and swipe my fingers to find the windows I want. If you too would like to get started with i3 you can take a peak at my dotfiles repo with my config in it.

I have now switched away from i3 to Sway for reasons but Sway aims to be a drop in replacement for i3 so configs can be shared but it out of the box does a lot of things nicer and runs on Wayland instead of X.

Faster Local Development

Like a lot of people in 2019 we run all of our sites on Docker, and have been for the past couple years. Docker is great and has made my life so much easier. At Code Koalas we don't just run Docker on our servers for live sites we also run those same Docker containers locally to build our sites. The great thing about this is that everyone is running the same version of PHP and has things setup the way that the stage and prod environments do. The bad thing about this is Docker for both Windows and Mac is terribly slow and buggy. Docker is meant to run on Linux servers so it runs best there and everywhere else it works but not well. Running Linux as my desktop computer means that I have the same great version of Docker running millions of services on my computer running my local sites.

Many coworkers message me asking "do you know what this container error means" with their local containers getting blown up. I'm not going to say I never have had issues but I know I haven't even had 1/10th the amount of Docker issues people on Macs have had.

How much faster?

This isn't a super scientific answer with rigorous testing but on my 2015 MacBook Pro clearing the cache on a Drupal site while on linux generally takes around one minute to around a minute and fifteen seconds. A coworker using the same model MacBook Pro but on Mac takes over three minutes to clear the cache. This is us using the time command in terminal before our drupal cr all command, and ran multiple times so in our testing Docker on Linux in three times as fast. Now that I upgraded to a custom build desktop computer at work running Linux my cache clears and 15 - 20 seconds.

Made Me A Better Dev

One of the great things about using Arch Linux and Sway is that I'm in the terminal a lot to manage a lot of computer services. Yes there are GUI for a lot of things but I personally prefer the terminal and when I'm managing remote servers all I have is a terminal anyways. I'm now way more comfortable poking around on servers trying to figure out what went wrong with them or turning on extra PHP extensions that we are missing. I now can tar a directory without having to look it up online. I also now look at the git repos of most projects I use on my computer and have seen at least a little bit of the code that goes into making the software I use daily work.

There isn't one specific thing I can point to with using Linux that made me the developer I am today but since I made the switch I'm way more knowledgeable than I used to be.

Is it really all good? Short answer no

Nothing is perfect, not every part of using Linux has been easy and great. Yes I have bricked my computer before, but I also did that on my Mac with a bad regex find and replace. Yes an update made a certain program not open anymore or function at all, but a Windows update made people lose all their info in their User folders.

The only real issue I have is I cannot use Adobe products, there have been hacks in the past that make them work but none seem to work right now. To me it's not that big a deal because when a client gives us designs in Photoshop I can always look at a JPG preview of it for general ideas and either open it or my old MacBook Pro or open it in a VM on my main computer. It's not a great solution but it's a small part of my job and Linux made the main part of my job way better so it works out. No GIMP is not the solution, I don't make the designs I open them and GIMP, though it's great, doesn't always render them right so I then build things that aren't actually part of the design but a GIMP mess up.

Conclusion

Is Linux for everyone? YES, I mean no, err maybe? Linux has been great for me and I'm not leaving anytime soon but I understand why some people don't make the jump. If you have every been curious or are finally getting frustrated on Windows or Mac give Linux a try, you might just like it enough to stay.