Ask HN: What & how do you code on your Mac?

8 points by jessewmc ↗ HN
Virtualized linux (windows)? VMWare, Parallels? Dual boot? XCode, native APIs?

What languages, IDEs, text editors? What do you build?

I'm looking into a Mac (Air probably) for coding and I'm wondering what all the options are. I know they are widely used by people here and I'm curious as to your coding experiences. Personally I will be doing alot of systems/network programming for school, so I'm most concerned about socket programming and accessing network functionality through virtualization and/or portability (in C) from the BSD subsystem to linux/solaris school systems.

Of course I dabble in alot of other things as well so whatever and however you build on your Mac, it would be great to hear about it and how you feel about coding on a Mac.

31 comments

[ 2.6 ms ] story [ 70.4 ms ] thread
aw come on. Someone has to have an answer to this, I'm quite curious.
I have a MacBook and a MacBook Air (both fine laptops for coding) and I use mostly vim running inside iTerm (far superior to OS X's Terminal imho) for my IDE and C and Python are my languages of choice.

When I write Objective-C w/ Cocoa, its X-Code all the way. It has a lot of excellent features.

Socket programming with C would be no different than writing it in FreeBSD. I had some network daemon that I wrote under FreeBSD that compiled and ran under OS X with absolutely no modification. You have a full GCC build chain on OS X either by default or with the X Code package, don't remember exactly. That same code will probably also run under Linux, with slight or no changes; and those changes will probably be only about including the right headers.

I love coding on my Mac. I generally used to code under FreeBSD at home (MacBook is my current `everything' computer) and currently code in Linux at work. Feels fairly similar between environments since I have a full screen terminal most of the time.

I didn't quite gather what you wanted to do with virtualization, but Parallels and VmWare Fusion work great. You can also get a qemu frontend.

If you have any other specific questions, don't hesitate.

Have you tried the Terminal in Leopard? It's much better then the Terminal was in Tiger. Also, iTerm hasn't been updated in awhile and has a few performance issues.
OK, that's got me intrigued - I haven't really noticed a difference between the terminal in Tiger and the terminal in Leopard. What are the improvements that I'm missing out on? :-)
I'm not really a "Mac" developer, since I don't (yet) code for the Mac APIs, but I'll respond anyway:

I primarily code in Python and Javascript, but also some C/C++ non-GUI stuff. I tried a few different cross-platform Python IDEs, but nowadays I just use TextMate. I use iTerm for the terminal.

TextMate's a great app for a lot of different things... Markdown, Python, C++, Javascript, Mail... it has a lot of plugins to help write code and text in different languages. That's great, and it allows you to be really productive. My only gripe is that it hasn't been updated substantially lately; while it's a great product as-is, I'd like to see a few improvements to the interface.

My network programming has been mostly just from Python, but I haven't run into any problems with OS X's sockets. I'd imagine it'd be nearly identical to BSD systems, and I'd also suspect that it you would not encounter much difficulty shifting between OS X and Linux compiling. Someone else might know more specifics.

My oft-repeated slightly OT 2cents: don't code on any notebook (including an Air) for extended periods of time: they're very unergonomic.
If you need to do Linux-specific coding and I do mean _specific_, like using libraries or kernel apis that are Linux and not "unix" (e.g. epoll() or inoitify()) then you will probably want to compare VMWare and Parallels and pick one for your virtualization engine. This will also give you access to windows, which can be useful at times.

Otherwise, you will find a Mac to be an very nice BSD box. Get macports and you will have access to just about every open-source project and library you might want.

For editing I use Emacs for Erlang, Eclipse/PyDev for python, and Coda for web/javascript. Textmate is also highly regarded, especially in the Ruby community. The only language that you will find yourself lacking will be c# and other CLR variants, but if you really need them you can try Mono or run Windows in VMWare/Parallels.

The only other suggestion is less of a Mac tip and more of a coding on a laptop tip: get a more ergonomic keyboard and a larger monitor that you can use at your primary coding desk. It really makes a difference for long coding sessions.

Non OS X BSDs have far larger amounts of packages than MacPorts, and don't require all applications to be stopped and the kernel shut down for application updates, like Apple Software Update does.

OTOH, I think OS X has more usable desktop software than any other OS.

Macports may not have everything that is in the bsd ports system, but it is pretty damn close. For everything else it is not too difficult to do the configure ; make ; make install dance...
I was very excited to buy a Mac Mini the other day. I was very disappointed to learn over several weeks that, despite what Paul Graham and DHH and others say, OS X sucks for hacking.

I experiment with a number of languages, I pull in many different libraries, I use various different tools and scripts and programs from the command line. Frankly, installing any one of these things onto a Mac is a pain.

In Ubuntu, I simply do apt-get install. On a Mac, I have to download a tarball and compile it (their package management systems have many fewer packages, many of which are out of date). If I wanted to compile things, I would use Gentoo. Actually, Gentoo is much better since I think the portage package management system is very well-developed, up-to-date, large, fast, handles dependencies brilliantly, and has the option for some binaries.

As for the general use of the Mac: if you want to do anything that is not the default, good luck. Learning all of the different ways you can do something non-standard on a Mac is like learning black magic. You have to Google around to find out the secret incantations. For example, to ask for the boot menu, you must psychically know to hold down ALT as it boots. The other day, I wanted to test out how well my site worked with Flash off, only to discover I couldn't. I found a site with some complicated instructions about how to go about disabling Flash on OS X. I just gave up and rebooted into Ubuntu.

Basically, hacking on OS X is exactly like working with linux 5 years ago, when I had to be an expert on esoteric systems to do what I want.

Just do what I do: dual-boot into Ubuntu. I boot into OS X when I want to use iTunes, watch TV/movies using the cool Mac remote, or develop iPhone apps.

Have you tried macports?
I find Ubuntu much slower than OSX, Have you found this also?
I find the opposite - but that may be more to Finder as a file manager compared to Nautilus, rather than Quartz compared to X.
Summary of every bit of advice you've gotten, or will get, on this page:

* Install a good package manager

* Install all your dev packages

* Install what was missing by hand

* Install a decent terminal

* Purchase Textmate

* Find a hack to allow mouse button paste

* Realize you're spending time trying to turn your OS X install into Linux out of the box.

* Install Ubuntu.

Erm, no, installing things is a breeze. Either use MacPorts (where it is as easy as cd to a directory and type "port install") or you get a .DMG file. Double click it and it mounts a filesystem, you drag from there to your Applications folder, job done. And holding down a key on boot has been around, since, well, as long as I've been using Macs, the early 90s. There are obviously going to be teething troubles on a new platform but "I don't know how" and "it sucks" are not causally related.

For the record, on the Mac I use Carbon Emacs and various languages gotten from MacPorts (Python, OCaml, GHC). Back in the pre-OSX days I used CodeWarrior and Powerplant, so I'm confident I could use XCode easily enough - just don't do much C at the moment.

The post you're responding to is aware of Mac packaging software - you don't seem to have read it.
No, the post he was responding to was markedly ignorant of the macports system and seemed to think that something as simple as apt-get was completely unknown in the Mac world.
Read it again:

> In Ubuntu, I simply do apt-get install. On a Mac, I have to download a tarball and compile it (their package management systems have many fewer packages, many of which are out of date).

Which would be a lot more credible as a comment if he'd given any indication at all that he knew which package managers were available on a Mac, and giving specific examples of packages that are 'out-of-date' and by how much.

Instead, there was a throw-away one-liner, which gives the impression that he doesn't know what he's actually talking about. All of which is to say that I personally think that the person you responded to had read the post, and came away with the same impression as me - that perhaps the OP needs some pointers in the right direction.

The generally accepted wisdom is that more OSS is developed, and thus available, on Linux than other platforms. Since you're challenging that, the burden of proof is on you.

I'm not the OP, but why not try listing the total amount of packages in macports, then listing the total amount in Ubuntu universe, and then deciding for yourself?

The post you're responding to is making the point that the impression the OP gives is that he doesn't know what he is talking about, not that the Mac has more OSS than Linux - you don't seem to have read it.
I thought he was saying that the Mac has the same amount of OSS software available for it as Linux.

If it doesn't, and you agree with the OP, fine. Stop trying to say it does.

Stop trying to is does

Ummm, because I said that somewhere? I don't suppose you'd mind showing me where?

Aside from software others have mentioned, I find myself using Coda frequently.

When I'm working on a variety of different websites via SFTP, and it allows me to quickly log into a website, make a few changes, hit save and be done. No fiddling with another client or syncing.

You can create a preview pane to the right of the code, so when you hit save, it auto-refreshes the website. That's snazz-tastic.

For all out quick changes, I haven't found anything that beats it.

It has a great CSS editor, too. (If you haven't played with it, give it a serious try. I like to hand-edit CSS, too, but for playing with pixel perfect alignments, it can be quicker.)

My toolset is Firebug for Firefox and Smultron for my text editor. Photoshop for visual aspects of design. For software dev, a LAMP dev environment running on an EC2 instance connected to my local SVN repository.
textmate. vim.

gcc. python. django. it's all good.

So - I code on stuff for my startup (http://www.bionicbooks.com) across all 3 of a g5 mac, an xp pc and ubuntu on a thinkpad. I use java and the major downside of OSX is that you cant use the sun jdk, you have to wait for apple's version which is inevitably at least 1 major release behind (and generally forces you to pay up for the new OS release if you want it). Additionally you have to deal with the odd keyboard arrangement and unconventional home and end key things which might be a hassle if you're not used to them. Package management on the mac is more of a nuisance than ubuntu; installing mysql, php, whatever, is always much more of an effort (of all 3 machines the mac is the only one where i keep notes of how I installed things).

I've seriously considered getting a Mac Air but for my stuff I couldn't live with OSX full time, I'd have to install Linux. And if you're going to do that then you might want to look at other SSD laptops; rumor has it that Lenovo are going to launch an X400 based on Centrino 2 (Montevino) which came out this week. Whether they do or not, the X300 is still an option.