The first time I spun up a web dev server in the Terminal app on my Macbook, I knew I had graduated to the major league of development. Little did I know, this code stuff was about to get 1000x more complicated than I’d ever imagined.
Now, a decade later, I’m convinced: you shouldn’t ever have to think about starting up a dev environment on your machine – in fact, you should abandon it entirely in favor of cloud development workspaces.
How did we get here?
Open up a Terminal window and you’ll feel like the ultimate hacker. Seriously, try it. You’re presented with a black screen and a white cursor. That’s it. Good luck from here, soldier.
What makes it intimidating is also what makes it so powerful. With the Terminal you can interact with your entire computer via code rather than a user interface. The ultimate efficiency hack for geeks and shortcutters.
Therein lies the problem. You see, when you give developers the ability to do anything, what do they do? Everything. The answer is everything. And it often turns into a convoluted, tangled mess.
Some projects I’ve worked on over the years have had some of the most ridiculous dev environment setup instructions. First, run `yarn`. Then, install Docker. Whoop, don’t forget the sudo there. You’ll need to have at least 80GB of HDD space available. Make sure you create a folder here and a config file there. Open a new tab and run these 6 processes. This step will take 10 minutes, so go for a walk to clear your head. And we haven’t even begun to talk about the actual codebase yet!
Back in the day, I used to be able to pop open a Textwranger window and get to work. Somewhere along the way, we decided that wasn’t good enough. We decided to redevelop the world of software development.
In one project, after consulting the development environment documentation for the 4,726th time, I snapped. “We need to reduce this complexity! I can’t even follow how to get this project set up on one powerful desktop machine, let alone my old 2012 travel laptop!”
I prayed to the heavens for alternatives. And cloud development environments smiled down upon me.
Reproducible setup
The number one feature that immediately sold me on cloud workspace was the fact that you can orchestrate the dev environment setup in a single .yaml file. When you create a new workspace, your .yaml configuration will instruct the workspace on how to start your project. This is true for any user who starts your workspace, on any machine.
Cool, but doesn’t Docker already do this? Yes, but there’s more. The .yaml file can also configure the remote code editor preferences, expose ports to public or protected URLs, and open up browser tabs on start. You can also inject custom code at different steps of the initialization process. Think of it as if your Docker container had a Docker container.
Dev workspaces are a dime a dozen
Imagine a world where you finish your work for the day, close your laptop, then walk over to the trash can and toss it in. Silly, right? Your laptop has files and settings unique to your life. You can’t just walk up to any old computer and get all your work from your trash-top back.
Or can you? This temporary behavior is exactly what Cloud Workspaces promotes. In modern development, we often store our code changes to cloud storage options like GitHub. If the code is saved in the cloud and the workspace is easily reproducible, you can delete the workspace when you’re done working for the day and forget about it. Tomorrow, you’ll create a new workspace based on your work from yesterday.
This ephemeral state feels unnatural the first time you use it, but you soon see the beauty of cheap dev environments. Just like git branches, you can create them and delete them as you see fit.
Available always, everywhere
I was a little hesitant at first. Cloud Workspaces like Gitpod must be clunky to use. I mean, you're writing code in a browser tab. What if I don’t have access to the internet? Won’t I miss VS code?
But then I tried it out. Wi-Fi is almost always available to me, so the connectivity issues aren’t a real concern. If I have VS code installed on my machine, I can open the remote project locally with one click using tunneling.
But the real gem here is that you don’t have to have anything installed but a web browser. You can connect to your environment using any computer on earth with Wi-Fi connectivity. Code from an iPad, a Dell running Windows 7, heck, maybe even a Tamagotchi, for all I know. If your device has access to an evergreen browser, you’re good to go.
Cloud environments are the future, and the future is here. Give it a try using GitHub Codespaces or Gitpod–you can thank me later.