Hacker News new | ask | show | jobs
by amalag 4138 days ago
Everyone is suggesting VM's but I found them far too much of a pain. Homebrew has been able to install all databases and other dependencies for me.
4 comments

I really like the idea of a VM on mac OS too, but recently I've been experiencing nothing but trouble... I use to develop on a Ubuntu machine and having everything running natively, then I started to work from a co-working space, so I setup my Mac with Vagrant, Virtualbox, Ansible (for provision), to run my Django app, and after that I noticed that all my browser calls to the local development server were taking between 1 ~ 5 seconds (with tons of involuntary context switches in the debug toolbar), when they take 300 ms on my Ubuntu machine... I've heard that last Mac os has trouble with DNS, maybe that's what it is but I don't really know what to do. So as much as I like how clean it is to build a VM and separate it from the rest of your system, the overhead and the network latency is too much for me, I'll stick to installing everything with brew and virtualenv locally.
Search "Mac fix DNS" and you'll find what to do.

Here's an example: http://arstechnica.com/apple/2015/01/why-dns-in-os-x-10-10-i...

I'd say go with VMs.

It's only a pain if you don't invest a week or so to master their use (which a knowledgable unix dev can also do in 1-2 days).

Installing "all databases and dependencies" on the Mac with Homebrew is not scalable, and it's not repeatable, and it's too kludgy. And when multiple versions of libs and such start to be needed, it wont even work.

(For small scale stuff, like some Wordpress development, it might be ok. But it would still be better to use a VM).

You won't deploy on a Mac in the end, but on some Linux box, so develop on a VM offering the same environment.

Note that I would still develop on a VM even if I was using Linux as a desktop -- you should not mix your desktop machine with your development environment.

IMHO, having a VM in hand may help you align both your dev and production environments.
I agree with this. Having the same environment in production as you have in dev will help avoid a lot of integration issues and specialized configurations which you have to maintain. I've had many production issues pop up in the past which were solely due to assuming things in production were similar to my development box.

Plus, many of the available database installs are much more fragile (and use older versions) on my Mac than they are on a VM.

The only time I see local development working particularly well is for front end development, where the part that matters is in the browser, not the server.

How do people find the battery life overhead? A quick test showed a Flask dev server tool 25% in a VM compared to less than 2% natively.

That would seriously restrict my ability to develop on the move or away from my desk.

First, 25% of the VM's CPU (seen in the VM's "top") is not the same as 25% of the host CPU.

Second, do you develop on the move unplugged for large stretches of time? Where is that place that doesn't have a plug?

> First, 25% of the VM's CPU (seen in the VM's "top") is not the same as 25% of the host CPU.

I'm talking about host CPU

> Second, do you develop on the move unplugged for large stretches of time? Where is that place that doesn't have a plug?

Anywhere with sunshine and fresh air. We don't get many sunny days in the UK and I'm damned if I'm spending them indoors.

Well, if you're based in the UK, you should be alright with an 8 hour battery to make it through those sunny days without recharging.
That's my point. This would be an extra 20-25% on top of what I'm already getting.

Which is a big chunk of time.