Developing on Mac

Apple's Mac makes a fine development computer but it takes a bit of adjustment for a PC user
Apple’s Mac makes a fine development computer but it takes a bit of adjustment for a PC user

I’ve made a job switch and at the new job I’ve started using a Mac to develop. I used to do a lot of audio engineering on Macs, about seven to ten years ago. Then a thief smashed my truck window and stole my Macbook Pro with nearly $2000 of audio software on it for an over $4000 loss overall. (Never leave your Mac in a parked vehicle, even for “just a minute” while you “run inside and grab something.”) Since then I haven’t used Macs much, although my wife has one that she uses for her photography business.

The point is I’m not new to Macs. In addition, I have a couple years of web admin experience in Unix. So the terminal in Mac OS is familiar. But I was a bit rusty on Mac usage overall, at least compared to the level of PC usage I’ve experienced over the last twenty years. And there are a couple of quick configurations I had to make to get things to a good starting point in Mac OS. So let me share them for what it’s worth, just in case anyone else out there finds these useful.

Using the Microsoft Natural Ergonomic 4000
I use a Microsoft Natural Ergonomic Keyboard 4000 and I know a lot of developers use them, but they are not very familiar to PC users who plug them in to a Mac for the first time.

There is a Mac driver for the 4000 available on Microsoft’s website. Shortly after installing the driver, I realized it is far from perfect. Still it is better to have it. The driver offers the option to swap the position of the Command and Option keys back to the normal Mac positions. On the other hand the driver mysteriously doesn’t load upon startup in Mavericks. So the first time you reboot, things go back to that first-time experience pre-driver-install.

So there’s a missing installation step you have to apply to get the drivers to load properly every time. Even then, if you have a Macbook and do a cycle of plugging it in to a display / keyboard / mouse combo and then unplugging it to go to meetings and then coming back again you are going to find that the drivers get “lost.” You have to take a moment to go back to System Preferences and load the Microsoft Intellitype pane to get things working again. I don’t know any workarounds. I’ve now made peace with it.

Using Eclipse Shortcuts
Switching from PC to Mac Eclipse is pretty intuitive if you just remember that the Command key (for the most part) replaces the Control or Alt key in keyboard shortcuts. For example, you might be used to pressing Alt+Shift+R for “Open Resource” and Ctrl+T for the “Type Hierarchy” but now you should press Command+Shift+R and Command+T respectively.

Home and End Keys
One thing that does not work like a PC are the home and end keys. In Mac-land, home and end pressed alone are equivalent to Ctrl+Home and Ctrl+End in PC-land. And don’t even try to select to the start or end of a line with Shift+Ctrl+Home or Shift+Ctrl+End.

There is an app called KeyFixer you can find which will restore a PC-like interpretation of the home and end keys for most programs. To restore the experience to what you are used to in Eclipse, though, you have to go to Preferences and remap the keys. Luckily someone has written a handy post for both obtaining KeyFixer and also where exactly in Eclipse preferences to go to remap the keys. I have remapped some other keys (like backward and forward history) also.

BASHing away
The other thing you might want to be aware of is that the Terminal in Mac OS X uses BASH, not another shell like ksh or tcsh. In my past Unix-life, I was a tcsh user. Just know that this is bash.

Quick tip: If you find yourself typing some command or set of commands almost every time you open the Terminal, create a .bash_profile file down in /Users/your_user_dir and put those commands in there. I set up some quick variables to hold common directories I change to and some source control settings. Now I can type “cd $TRUNK” to get into the trunk of my codebase, which is much nicer than typing the whole path to it.

Text editors, Diff tools, and so on
I can’t say I’m an expert on what developers on PC’s use but mostly I have seen people using Notepad++ for a text editor and either DiffMerge or WinMerge for a diff tool. Luckily DiffMerge has a Mac version so there’s no adjustment there. On the text editor side, there is unfortunately no port of Notepad++. You can learn to use vim really well or go grab TextWrangler or Komodo Edit. Those seem to be the most equivalent text editors to Notepad++ but unfortunately I wouldn’t say they achieve the same ease of use. Your mileage may vary.

Share your helpful Mac tips
If you happen across this post I’d love to hear in the comments below any other useful suggestions you might have for developing on a Mac. It’s been a couple weeks now since I first set everything up and I am cruising along just fine, but it feels like the Mac OS is pretty hackable, so I am definitely interested in hearing your tips. And for those who are just setting out on the PC-to-Mac switch, I hope the above was helpful.

3 thoughts on “Developing on Mac

  1. Jared

    If you’re looking for a solid text editor there are lots of Mac options that are really good. You could try BBEdit, Sublime Text (there’s also a Windows version), TextMate, or my favorite which is Chocolat.

    As for keyboards I had a newer MS Sculpt keyboard and didn’t need any special software to use it. There’s a system preference that lets you flip keys. I did hack it using KeyRemap4MacBook to get things just right though.

    Let me know if you have any Mac questions!

    • Scott Shipp

      Thanks Jared! Given my Unix background I have just been using vim but sometimes there are reasons to use something with a GUI. I’ll have to check out all of your recommendations!

Leave a Reply

Your email address will not be published. Required fields are marked *