Weblogs: Gadgets and Stuff

Web Development on a Mac just makes sense

Tuesday, March 29, 2011

I was grudgingly converted to a Mac for Web Development. For the range of work I do as a web developer it is the best choice for a flexible and productive development environment. The Mac offers one killer feature for web developers of all persuasions: it is the only piece of hardware that can adequately run any modern web browser and offer an accurate local production-like development environment, on one single piece of hardware.

Running Ubuntu as a desktop/development environment because that uses the same package manager as your production servers is short-sighted and limiting. I have tried Windows and Ubuntu setups, the Mac is the superior desktop environment for modern web developers.

The pre-Yahoo years

I learnt my trade with Windows 95 and 98, so I grew up in a time where running a webserver for local development entailed running a Java-based server off a command line. Before PHP surfaced as a viable and widely available scripting language. My preferred editor through those years was Textpad, mainly for it’s ease of use and configurability. Sure Vim and Emacs were more powerful, but the steep learning curve meant that Textpad remained essential for a productive environment.

As Windows merged into XP, I switched to Windows 2000. Mainly because I could run Apache and MySQL as services. That opened up server-side development with Perl and PHP (and at times Tomcat and JRun), and into fully dynamic sites. All developed in TextMate (and the odd foray with Eclipse).

Those tools remained firm favourites when I joined Yahoo in mid-2006. Over those years I tried Linux off and on, but it didn’t measure up to my current development environment, though I felt held back by not being able to take advantage of a significant number of PHP extensions that weren’t available for the Windows environment (and Cygwin, however quaint, is more trouble than it’s worth).

The Yahoo conversion

Joining Yahoo I had the choice of desktop, a Mac or Windows. I opted for Windows. The main reason for that was my lack of confidence, and I felt that having to spend time getting up to speed working on a Mac would add frustration and further damage my confidence.

So in a team of 30 plus world class web developers in London I was a part of a tiny minority using Windows. Most of those Windows users had been at Yahoo for a long while and were coming up for a hardware upgrade, and they opted at that point for a Mac. So that left me as the loner on Windows.

To be honest, I still think originally choosing Windows at that time was still the right decision for me. Mac was still PPC-based, Parallels was just starting to have an impact in Virtual machines for cross-browser testing; and Safari was just about to enter a seriously dramatic run of improvements making it into a world class browser.

I’d resisted efforts to get me a Mac, I felt that asking for a Mac halfway through my 2-year upgrade cycle was unjustified and selfish.

But the web development team acquired a spare Mac that the bean-counters had overlooked. It was actually Ben Ward’s Mac when he emigrated from our Web Development team across the Atlantic and the fly-over states to BrickHouse. Since Ben wasn’t leaving the company, he didn’t have to give back his Mac; but there was a nice shiny new one waiting for him on the other side because he was a new employee to Yahoo (one of the few times I’ve benefitted from a different interpretation between US and the UK).

So Norm, being the very generous colleague and friend he is, suggested I take Ben’s Mac and use it as my main development machine. I was reluctant, so Norm simply challenged me: try it for two weeks, and if at the end of it I don’t feel like it works for me I could go back to my Windows machine, and no-one would trouble me with it again.

The great thing about that challenge was I was amongst friends and colleagues who had been developing on a Mac for years, so whenever I got stuck or needed to find out how to do something I had people around to help out and show me. The advantage of having a “hand-me-down” was that all the software I would need was already installed and set up for a web developer (and Ben Ward is very particular about his choice of tools, so I was getting the best the Mac has to offer, pre-configured). I bypassed the missing software problem. I was productive almost from day one.

I got to learn Quicksilver, slowly finding my way around TextMate, and seeing immediately the great benefit of virtual machines in testing multiple flavours of Internet Explorer, sometimes side-by-side. The switch to Intel-based processors for Macbook Pros meant that Windows virtual machines ran close to native speeds. The Macbook became not just a viable web developer machine, but an essential one.

This environment has one killer feature. Every modern mainstream browser in use during 2007 through to 2010 could be tested by someone with one computer; if that computer was a Mac. On Windows, you’d need a spare Mac. On Linux, you’d still need a spare Mac, and loads of patience.

After two weeks I elected to continue using the Mac, and Ben Ward’s old Mac served me well until my Windows machine reached it’s upgrade point, and I upgraded to a brand new shiny Macbook Pro of my own. I haven’t looked back since.

The alternatives

At home I gradually migrated off Windows 2000 to Windows XP as my current desktop specification started being prefixed with Giga instead of Mega. But I rapidly lost patience with Windows XP, which required rebooting at least once a day.

At home I made a complete switch to Ubuntu. And this time it stuck. For well over a year I learnt to ply my web development skills on Ubuntu. I was comfortable with the environment, but I found Gnome to be too sluggish on my one-generation-behind Thinkpad (the CPU fan running in overdrive almost non-stop was the last straw), and after some consideration I switched to Xubuntu. The CPU fan quietened down considerably.

I had happy days using Ubuntu, mainly running Bluefish and an Xterm. Though I did struggle because I hadn’t found a decent and usable alternative to Paint Shop Pro. My foray into Gimp was an absolute disaster.

After another year I dug out my Macbook that had largely been doing nothing for a year and started getting it prepared for a development environment as opposed to an everyday web browsing machine. Gradually over the months I found everything I was doing was being done on the Mac, and my Xubuntu machine was just there for instant messaging, IRC and the very occasional long-download.

Today’s choice

Joining Lovefilm last year I wasn’t offered a choice of desktop machine. A pristine dual-monitor Windows XP machine was on my desk when I arrived (I was so dreading Vista or Windows 7). Considering most of my development is done across ssh to development servers means that it doesn’t really matter what the operating system of my desktop is. So I’m not particularly concerned about it. I’ve recently had Photoshop installed, so I can take some weight off our overstrecthed designers - their time can be better spent than fidgetting with extracting, spriting and compressing images on my behalf. Though I installed Mac-like tools into my work machine: Launchy because I can’t live without Quicksilver anymore, Evernote as a shared document repository, and a Twitter client or two.

Six months ago I decided to take my choice of home development environment seriously, and I splashed out on a 27-inch iMac. It took me quite a while to get used to the screen size, but I’m settled now. My development environment is based around virtual machines, textmate, shared folders and a terminal window.

I have several projects on the go, each requiring a different server configuration. So I have a virtual machine per config. One runs an out-of-apt-get-install LAMP stack, two more virtual machines have different sets of PHP extensions, another virtual machine runs just node.js, and I have a couple of virtual machines to dabble with CouchDB, Solr/Lucene, MongoDb. Whenever an interesting server-side tool crops up I can just copy a base-server install into a new virtual machine and give the software a go. Trying out a different configuration of nginx and wsgi, copy a virtual machine and give it a whirel. If it works, great. If it doesn’t then just delete the virtual machine and move on.

My use of virtual machines neatly mirrors my use of VPS for web hosting. I can develop freely on a virtual machine locally that matches the configuration of my VPS, and I know that what I develop will work on the final environment, because my development environment matches the configuration of the production environment.

Since we are dealing with proper linux servers running either as virtual machines or public facing VPS a web developer needs to be comfortable with a linux shell. So rudimentary knowledge of bash, package management of your server/linux distribution, and a console based editor. It’s worth getting comfortable with a console based editor like Vim or nano - text editors that typically are available on a base-install of a modern linux server distribution. It’s for the rainy days when all you have is an ssh connection to a remote server. (If you want to run emacs over ssh - that’s your prerogative)

Mac killer-feature: VMWare Fusion

Virtual Machines running on a Mac is a web developer’s paradise. For end-to-end developers like myself, it provides the most economic platform and flexibility in terms of server configuration and range of browser testing on a single piece of hardware. For the more front-end focused web developer, the same benefits apply: a development virtual server that mimics the production setup, and the ability to test and debug across all A-grade browsers without a second machine. For the web-developer with a closer affinity to web design and pure front-end web development, the Mac is the platform for graphical design. There is no other piece of hardware/operating system that can adapt to support the repertoire of the modern web developer.

Virtual Machines are disposable machines. Your desktop is not a production server. A production server should not interfere with your preferred working environment. Your desktop should reflect an environment that allows you to be as productive as possible.

(Disclaimer: I bought an iPad on launch day, I wanted an up-to-date Newton. I don’t have an Iphone, I recently bought a Nexus S instead; I like the idea of being able to run CouchDB on it. My friends are mostly Mac fans, but I still like them.)

[ Weblog | Categories and feeds | 2011 | 2010 | 2009 | 2008 | 2007 | 2006 | 2005 | 2004 | 2003 | 2002 ]