Saturday, September 17, 2011

Command Key: My First Month with a Mac Mini

For a while, I've thought about purchasing an Apple computer to see how Mac OSX compares to other modern operating systems. But curiosity alone was not enough to justify the hefty price for a Mac.
Around a month ago, my main development system got struck by lightning, so I made a decision to replace it with a new Mac Mini (with Lion).

General Use

Initially, the Mac Mini was hard for me to use. From a ‘general use’ standpoint, I am very used to the Microsoft Way: start menu for apps, Task Manager when stuff goes wrong, and closing windows means closing programs. Many window managers available for Linux distributions follow many of these same conventions, but OSX bucks the trends in this regard. I slowly grew used to how things works on a Mac.

It took me around 15 days just to be familiar with shortcut key combinations in OSX. For most of the key combinations I regularly use, it seems that they are exactly the same OSX as they would be in Windows except with swapped Control and Windows keys. The two that bothered me the most were browser-related. Command-L selects the address bar in OSX, but Windows-L locks your screen in Windows. F5 in Windows refreshes the current page, but the refresh shortcut in OSX is Command-R.

Accidentally press Command-F5 and this pop-ups
and starts reading to you.
Window management was initially confusing but became manageable after I got comfortable with shortcut keys and app-specific features like Safari’s “merge all windows” feature. I also learned to leave applications open. I think that the whole ‘leaving applications open’ thing is the weirdest part of Mac OSX: in Windows, I’m used to closing windows when they’re not in use to reduce resource use and save space on a taskbar that can get easily cluttered. On OSX, it is preferable to leave apps open, and the OS closes applications that are not in-use.

Developing

After getting used to the Apple Way, I started testing out various development tools and learning about them.

XCode taught me that, if I want to use XCode, I should buy a more expensive Mac. I bought the cheapest new Mac Mini that I could, thinking that I wouldn't be out so much money if I ended up hating it. My little Mac Mini isn't beefy enough for XCode. I was trying to work through the official tutorial named “Designing a User Interface with Interface Builder.” After a certain point in the tutorial, XCode started showing a live preview of the Quartz Composer view, and the entire computer became unresponsive to the point of annoyance. When it’s not inexplicably showing a resource-intensive preview, XCode has some good aspects (‘build success’ popup visible on every desktop) and some confusing ones (like the UI in general).

MacVim is great and lightweight. My favorite thing about using a Mac is using Vim, a text editor for insane people available for almost any platform. MacVim supports Mac-style copy and paste out of the box, looks good by default, and even has Apple-style ‘zoom’ and Lion-style full-screen mode. I like MacVim so much because it brings Vim (something that I am already used to) and puts it on the Mac in such a way that it ‘feels’ like a normal made-for-Mac app. MacVim was essential for me in getting used to OSX.
MacVim, full-screen.

After installing my text editor of choice, I wanted to try my hand at node and Lua development, so I grabbed a user-created package manager for the Mac called Homebrew. I read about it before getting a Mac, and I was under the impression that Homebrew ‘just works’. I must confess: I actively dislike it. I encountered a number of Lion-only problems, including not being able to update unless you work some command-line magic to change file modes. I could not figure out how to get Luarocks working; its compile would fail because the script could not locate Lua on my system. NPM is not available on Homebrew due to numerous issues where npm cannot play nice with Homebrew. Updates can take a long time too: I updated Wine and node once, and the process took so long it reminded me of that dark afternoon I spent with Gentoo. I could take a stab at fixing these problems, BUT I don’t have a Snow Leopard Mac to test these changes out on, and most people using Homebrew are probably still using Snow Leopard. It’s a terrible shame, given that the alternatives (Fink and MacPorts) look worse. Despite my bad feelings about Homebrew, I think that it will improve over time as more developers migrate their primary systems to Lion.

Other than Homebrew heartache, development work on a Mac was mostly painless. I was able to grab a personal project from GitHub, make a change to it, and push changes. In fact, I discovered a display bug in that project that isn't apparent in Ubuntu or Windows.

Final Thoughts

My first month or so was full of ups and downs, but I can say that I am happy with my purchase. I might switch back to using a Linux distribution of some kind for working on personal projects, but that's something that I’ll have to figure out later.