Live data from Hacker News

Ask HN: Best practices for OS X dev environments

news.ycombinator.com

1–10 of 57 posts

Ask HN: Best practices for OS X dev environments

#1
I'm about to get a new Mac and will be starting fresh on a new drive. I would like to know if there are any best practices in regards to creating multiple user accounts, with different permissions for my scattered development work.

I spend time with node, python, and RoR. I like cloning projects from github and taking them for a spin. I test out bitcoin projects, and send GPG emails, and ssh into multiple servers. And I do all of this on my main user account that has sudo.

Is there some best practice that I should be aware of that would have me use multiple unix users on my new Mac?

Re: Ask HN: Best practices for OS X dev environments

#2
Use one VM per project, not Mac OS X. Unless of course you're deploying on Mac OS X.

Use snapshots and switch between them when disk space becomes an issue.

The big advantage is that, either through careful notes or configuration management, you'll actually be able to recreate your development environment in the future.

Re: Ask HN: Best practices for OS X dev environments

#5
Don't install server-side stuff directly on your Mac. If you are working on server-side projects, then use virtual machines. Vagrant in combination with a configuration management system (e.g. Puppet) is very helpful here.

Use Homebrew to install command-line tools. Use Homebrew Cask to install GUI tools that aren't on the Mac App Store.

Lots of people find it useful to check their environment's configuration files into version control – check out popular dotfiles repositories. On OS X, this also includes scripts that call `defaults write` for integration with OS X preferences.

As far as multiple unix users are concerned, just create them and use them. There's no special trick you need.

Re: Ask HN: Best practices for OS X dev environments

#6
I installed Ubuntu as a second OS since lots of the linux open source stuff just does work much better natively than with homebrew.

For server stuff I would use docker. For docker it's the same story, linux native is better than OS-X with boot2docker.

If you need a lot IDE's then OS-X might be the better choice since retina support is not yet as good on Ubuntu. On the other hand Sublimetext is perfect on linux with retina.

Re: Ask HN: Best practices for OS X dev environments

#7
post #4

I use vagrant + virtualbox (runs ubuntu via vagrant setup) + ansible to bootstrap the VM. I've had this setup for 2 years now. No issues and I get to use sublime to edit files locally while they are shared with the VM.

Vagrant with shared folders is really nice. The specific feature is 'synced folders': https://docs.vagrantup.com/v2/synced-folders/basic_usage.htm...

Re: Ask HN: Best practices for OS X dev environments

#9
post #4

I use vagrant + virtualbox (runs ubuntu via vagrant setup) + ansible to bootstrap the VM. I've had this setup for 2 years now. No issues and I get to use sublime to edit files locally while they are shared with the VM.

I do the same, but I've had trouble with the overhead of virtual machines (admittedly on an older laptop). Have you not found this to be a problem at all?

As deployments get simpler and the usefulness of Ansible for server config declines, I'm thinking about abandoning the VMs and going back to running things in OS X.

Re: Ask HN: Best practices for OS X dev environments

#10
Is the prevailing opinion then that OS X really just isn't a good development environment? Seems like most of the suggestions so far are "install one or more Linux VMs". As someone who develops on a MacBook Pro everyday, I know I definitely fall in the Linux VM camp.
Post reply on HN