Saturday, September 22, 2007

The Mac as a Software Development Platform

Many of my co-workers (and people in general for that matter) find it strange that I use a MacBook Pro as my primary development platform. The two main camps of developers I have encountered either lean towards Microsoft Windows or some flavor of UNIX. Most of them have never even considered using a Mac for software development. While I acknowledge that some tasks are platform dependent (ASP.NET for example), many tasks allow developers the freedom to choose their own environment.

The rest of this article will elaborate on features the Mac has that makes it a good development environment. In the conclusion I will speculate on reasons why I think the Mac has not become popular among the development community.

Where am I Coming From?

Most of my development tasks involve writing Java code and solving technical problems. I work in the payment industry and our customers use just about every platform under the sun. My company produces software written in Java, ASP, ASP.NET, Perl, PHP, and ColdFusion.


By default my MacBook Pro was fairly open. No password was required at login and account names were displayed on startup. It was easy enough to reconfigure and go back to a more traditional UNIX login situation that prompted for a user name and password. In addition, I was able to easily and transparently encrypt my home directory with file FileVault. Finally, the MacBook uses ipfw, the FreeBSD firewall. Ipfw can be configured through a tool in System Preferences and optionally its full power can be exploited through the UNIX terminal (more on this later).

Text Processing

A good portion of my time during the week is spent on text processing tasks. Usually I am creating a report, mining log files, or changing character encodings. Darwin conveniently provides almost every tool I need such as sed, awk, grep, Perl, cut, and iconv. A great way to impress someone who brushes Macs off as a computing platform for hippies is to open up a terminal and burn through an ugly log file with a only few commands.

Darwin Ports

I have always liked the OpenBSD ports system. While not exactly the same, Darwin Ports makes it very easy to install open source software on the Mac. I have used Darwin Ports in the past to quickly create a UNIX environment I am accustom to without having to worry about dependencies and compatibility.


Mac OS 10.4 comes with JDK 1.3 through JDK 1.5. Swing components are beautiful, all the standard tools such as Ant and Javadoc are bundled, and documentation packs are free to download on Apple's developer site.


One of the things that surprised me the most when I purchased a Mac was how painless it was to get X11 set up. Although I was slightly disappointed that it was not pre-installed, Apple did provide the X11 package on the companion CD. After a few clicks, X11 was automatically configured and running properly. X11 is another essential programs that I have grown accustom to. By installing X11, an entirely new category of applications can run on a Mac.


I have never met a VPN I couldn't talk to. I am able to connect to my corporate VPN via PPTP on the Mac at least as easily as on a Windows PC. My previous employer used SSH tunneling as a point-to-point VPN. No problem on a Mac, OpenSSH is installed by default.

Windows Remote Desktop

Microsoft provides a free version of remote desktop for the Mac so it is easy to work from home or access a Windows PC. One of the nice things this allows me to do at work is to hook up a second monitor and connect to my Windows PC via Remote Desktop. By doing this, I have a duel head Mac with a connection to a Windows box that can be controlled by a single keyboard and mouse.


I mention this specifically because it helped solve a particularly difficult problem. In a nutshell, we were attempting to improve the performance of our primary product. Our thought was that network latency was causing connection delays when the application's threads were entering a synchronized block. We ended up configuring ipfw on my Mac to introduce controlled network latency that made it possible to test and eventually correct the synchronization problem.

* * *

In conclusion, I assert that there are three factors that work against the Mac as a developer platform:

  1. Until OS X, the Mac was limited when it came to development. For me, limited software availability made Macs an ugly alternative to Windows or UNIX. I believe that Macs are still haunted by the stigma they carry from the pre-OS X days.
  2. When Apple switched to Intel processors it opened the possibility of running Windows in a non-emulated environment. Windows runs well on Intel Macs, Apple even provides Windows drivers for all their hardware. However before this recent move to Intel, Macs used PowerPC processors which would likely have caused unfavorable compatibility issues in the eyes of software developers.
  3. Price. Macs are about as expensive as high-end PCs. This is their biggest negative in my opinion. Since OS X is UNIX-based, a Mac platform is more attractive to open source developers. However, many open source developers may not want to pay for such an expensive machine.


James said...

The other issues I've found is that the Java version is tied to the OS X version and the lack of a non-beta/preview version of Java 6.

rogerv said...

The biggest draw-back is having to wait on Apple to catch up to the latest Java JVM version (and then they tend to only make the latest Java available with the latest or pending OS X release).

Otherwise, it's a superb platform for all the reasons you cited.

If you make Java developer conferences, you'll see that Mac laptops predominate amongst the session presenters - so much so that the ones still using a PC laptop are regarded as suspect.

Now if I could only go and download a Java JDK of my choosing the way I can on Windows or Linux...