Skip to main content

Command Palette

Search for a command to run...

How to set up a developer environment on Mac and PC

Published
โ€ข4 min read
How to set up a developer environment on Mac and PC
E

I am a commercial real estate professional making a career pivot & loving every second. ๐Ÿข๐Ÿš€๐Ÿ’ป

As a software engineer from a non-traditional background I can help others on their journey to join the tech industry.

The hardest part of becoming a software engineer is starting. New developers may feel overwhelmed and never take the first step.

Before writing a line of code every developer needs to first set up their dev environment. This article is to help non-devs dip their toes into the world of software development by providing an easy to follow step by step guide to set up every tool you need to start coding.

I guarantee this will be the simplest introduction to development on the internet and that anyone will be able to follow this guide.

Developer environment setup for Windows

To code on a windows device, you will need to download a Linux subsystem. This sounds much more daunting than it actually is. This is completely free and easy to set up.

You must have at least Windows 10 or higher to be able to set this up.

Microsoft has a really great guide here that you can follow. I will provide the same guide with pictures so you can follow along.

Setting up Windows Subsystem for Linux (WSL)

  1. In your application bar search for "PowerShell" and run this application as an administrator. image.png
  2. There should be a blue PowerShell terminal that opens up. Copy and paste this into the terminal and press enter:
    Enable-WindowsOptionalFeature -Online -FeatureName Microsoft-Windows-Subsystem-Linux
    
    image.png
  3. After this command finishes running restart your computer.
  4. In your application bar search for "Microsoft Store" and open the application.
  5. Find "Ubuntu" in the Microsoft Store and click "Get" then "Install" image.png
  6. It will install some files and then prompt you to "Enter new UNIX username", enter a username, and then it will prompt you for a password for your new user.
  7. Once you have your user, this command which should update all your packages:
    sudo apt update
    
  8. Once that is done upgrade your packages by running:
    sudo apt upgrade
    
  9. Next you have to configure Git by setting your git user name by running:
    git config --global user.name "Your Name"
    
    You should replace "Your Name" with your name.
  10. Next configure Git to use your email, you should use the email associated with your GitHub account:
    git config --global user.email "YourEmail@email.com"
    
    Replace "YourEmail@email.com" with your email.

Installing and configuring Visual Studio Code (VSCode)

  1. You will need to install Visual Studio Code, you can do that by going to the VSCode website and clicking download for Windows. image.png
  2. Once VSCode is done installing open it and it should prompt you to install "Remote - WSL" since you have Window Linux Subsystem installed on your system. Click install. image.png
  3. After it is done downloading close VSCode.
  4. Open Ubuntu and run this to open VSCode from the command line:
    code .
    
    This will install VSCode Server and open VSCode. image.png
  5. You can use this method to open your VSCode or just search for the application in your application bar and run it.
  6. That's it! You're all set up to start coding on your new code editor on a Window Subsystem for Linux.

Developer environment setup for Macs

To start coding on a Mac you have to download a few things. Instead of setting up a Linux subsystem like what we had to do on Windows, we will have to use Homebrew to use the command line to install software and tools.

Installing Homebrew

Homebrew allows you to download applications and tools. It is a package manager for Macs that simplifies installing software on macOS. You can check their website out here. It is open-source and 100% safe as long as you know what you're downloading.

  1. Open your terminal. image.png
  2. Run this command to install Homebrew:
    /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
    
    You will be prompted to continue or abort. Press RETURN to continue.

Using Homebrew to install Git

  1. Install git using Homebrew by running:
    brew install git
    
  2. Configure your git by setting your username:
    git config --global user.name "Your Name"
    
    You should replace "Your Name" with your name.
  3. Next configure Git to use your email, you should use the email associated with your GitHub account:
    git config --global user.email "YourEmail@email.com"
    
    Replace "YourEmail@email.com" with your email.

Install Visual Studio Code

You can go to Visual Studio Code's website and click download for Mac. You should be able to unzip it and drag it into your applications. That's it, now you can start coding! image.png

Conclusion

Once you have these basic tools set up on your computer you will be ready to start coding whatever you like. You can always download more tools and software. For example, if you wanted to start doing Ruby development you could install rbenv and Ruby using Homebrew or WSL.

If you are a complete beginner starting to learn how to code I would recommend checking out my beginner developer series. The next article you should read is the How to use Git and GitHub article now that you have set up your development environment and are ready to start committing code.

Thank you for Reading.png

D

Hi Edmond, I love VSC! Great choice for an editor.

Can you use bash commands to install homebrew on zsh? I ran into trouble doing this a month ago and had to use bash to install. Also, isn't $ is the bash prompt? Do you run the $ in the command?

Feel free to completely school me! I'm an artist first, and then a programmer. I look forward to reading more of your articles. Cheers!

2
E

Hey Maggie, thanks for the question!

The $ is necessary because it is doing a command substitution. Basically what it does is it allows a command to be run and its output to be pasted back on the command line as arguments to another command.

-c executes the command which downloads Homebrew.

I got this command directly from https://brew.sh/, you can read their documentation there.

1
D

Edmond Hui Thank you for your reply! I've heard of command substitution, but I didn't realize that's what that was. My knowledge of terminal is limited. I think that for less knowledgeable programmers like me, you could add this kind of info to your article. When I was googling how to set up homebrew and git a month ago, I found everything on my own that you listed, but it was hard to understand it. Explaining the commands with more nuance would add value to your article for people like me. Just a suggestion though! On my end, I will take more terminal courses :)

4
G

Nice article, Edmond!

Glad that the WSL on windows is getting more attention! I've always dreamed to be able to do some serious ruby coding in my gaming Windows PC, but despite the major breakthrough in WSL, it's still very slow compared to my M1 Macbook ^_^

2
W
Wojtek X3y ago

Hey Edmond Hui

  • not Virtual Studio Code, but Visual Studio Code.

That's it, now you can start coding!

Well, kind of. While above is true for those who want just to treat VSC as a playground of sorts, its not enough for any professional. For it, youneed to install extensions. At the very least these ones that greatly improves quality of work.

2
E

Thank you, fixed the typo. I'm a big fan of some extensions, I could probably write a whole article about the best VSCode extensions.

1
W
Wojtek X3y ago

Edmond Hui

I'm a big fan of some extensions

Oh yes, so do I..............some of therm is so must-have that should be added to core imho.

I could probably write a whole article about the best VSCode extensions.

Go ahead :) Im sure it will be good read :)

More from this blog

R

Real Estate Broker to Software Engineer

10 posts

Commercial real estate broker to software engineer! As a software engineer from a non-traditional background, I mentor others looking to break into the tech industry.