Setting up your environment! (sooo fun…)
So I’ve discovered lately that I am a pretty forgetful person and with a family mixed in, my tendency to forget is much worse. In most cases these situations don’t affect me too much but on the days when I forget to bring my laptop with me to work it does. As a software developer your dev environment eventually becomes VERY specific to you but in the beginning it isn’t. Every time I forget my computer I have to set up a new dev environment, which as all of you know can be maddening! The basic setup is mostly the same for everyone and really only differs with language specific tooling. In this walkthrough we will be focusing on getting your environment set up with Xcode, Homebrew, git, npm, and Node.js. I’ll also make some recommendations (based on personal experience) on some other applications that I have found to be very useful as a developer. So lets begin!
Wikipedia says that Xcode is an integrated development environment for macOS containing a suite of software development tools developed by Apple for developing software for macOS and other mac platforms. Its basically a huge suite of tools that we can use for developing applications.
To install Xcode just run this command in your terminal or in iTerm. You may be asked to enter your user password.
Homebrew is basically a package manager that allows you to install things on your system that Apple didn’t. It installs packages to their own directory and then symlinks their files into
/usr/local. To install Homebrew, run the command line below.
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
It will ask you for your system password. It needs this because it installs its packages in a place that all users of this computer can access. The process will take a minute or so, but when it has completed you can check that it completed successfully by running
brew doctor. If the installation was successful the response will be
Your system is ready to brew.
Git is a version control system for tracking changes in computer files and coordinating work on those files among multiple people. It is primarily used for source code management in software development. Xcode installed an older version of Git for you, but let’s update it. Run the below command in your terminal.
brew install git
Once the install is finished you’ll need to configure git with your name and email address. Run these commands in your terminal and substitute them with your name and email.
git config --global user.name "Bob Loblaw"
git config --global user.email email@example.com
curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.31.4/install.sh | bash
Once you run the commands above you’ll be asked to close and reopen your terminal. Do this and then run this command
nvm ls-remote. The latest version of Node.js as of this article is 8.7.0. Once you figure out what the latest version is run this line in your terminal with that version number.
nvm install 8.7.0
NPM (Node Package Manager)
npm -v. The latest version of npm at the time of this article is 5.5.1. If you have a version earlier than that run this command
npm install npm@latest -g to update your npm version to the latest and greatest.
So now that you have the most basic version of your environment set up I’d like to recommend some extra tools for you to download. Keep in mind that these are based on my personal preference and experience and yes, I realize everyone has a preferred browser and such. If you have your own set of tools that you prefer to use then this part may not be for you.
Ok lets lets proceed!
I’m forever a Chrome guy, mainly due to its great dev tools. Amazingly though google has released a bleeding edge, mostly stable version of its latest browser, Chrome Canary. There aren’t a ton of differences to the typical user but as a developer they’ve added a bunch of new dev features such as the audits panel, simpler network throttling, third-party badges, and so much more. Download it and give it a spin!
This is another one of those personal preference things. Every developer swears that their IDE is THE ONE! I’m of the camp that you should try them all and make an educated decision. I’ve tried Atom which is a great starting point, but I found it to be buggy and it also has some trouble working in large projects. Sublime was great but there isn’t really much new happening with it and there isn’t much support for it anymore, but it is very stable. Presently, I have been using Microsoft’s VScode. Its a pretty new product and does have some pain points but overall its a great text editor and comes with a ton of plugins. It also has its own debugger and terminal built in if you are looking to consolidate your workflow in to one spot.
Apple MacBooks come with the default terminal which works fine when you are starting out but once you get in to working on larger projects and need multiple panes open, terminal becomes much more of a pain and can be a bottle neck in your workflow. Introducing iTerm2!!! I love this application and find it to be very user friendly and customizable. With iTerm you’ll likely have no further use for the default terminal.
Need I say more?
When I’m working with multiple applications at once, I find that navigating them can get to be frustrating. What Spectacle does is give you the ability to quickly and easily place windows in different locations on your screen.
Well that pretty much sums up my thoughts on setting up a development environment. If you have any questions or thoughts on processes/applications to add to this please feel free to let me know!