From time to time something comes up that give me a good excuse to change my habits a bit. To summarize, my habits as far as software development goes is pretty much linux, usually Ubuntu in one form or another (the last few months I've been using Gnomeubuntu). It used to be that running linux on modern laptops required quite an amount of manual tweaking, but fortunately it mostly works great right of the box now. At least if you avoid the proprietary graphics stuff (Nvidia, AMD) and stick with Intel (HD3000 and upwards should suffice for most things, possibly except bleeding edge high performance bleeding edge graphics, for which Nvidia is probably the best choice, just try to avoid the Optimus stuff...).
Anyways, the opportunity to mix it up a bit presented itself shortly before Christmas this year when I needed to bring a laptop for some training courses I had to attend. The course required me to be able to run both Windows and Linux using VM images. My preferred travelling companion - a Acer laptop sporting an aging Sandy Bridge Intel chipset with HD3000 graphics - is starting to show it age, and the dealbreaker for this event was that it only had 4GB of memory. I also have a Mac laptop for iOS development, and since this is a more modern system with a whopping 16GB of RAM, it seemed like the perfect candidate for bringing along, so I started setting and using it for up a couple of weeks before my course. In the end I did not bring the Mac along; the training organizers sent out emails advising against using Macs, so in the end I brought along my Thinkpad W530 "laptop" (it's a tank, my office computer, more like a desktop replacement, not really very portable).
But since I had already set the Mac up, I decided to try and use it for my primary development laptop, similar to what I did a couple of years back. First of all, it's a Macbook Pro Retina purchased in spring 2013, so a fairly modern system. The build quality of the laptop is excellent, something Apple is famous for. It's solid, has a great screen, and a very nice keyboard and touchpad. For comparison I recently (December 2013) also purchased a brand new Samsung ATIV Book 9 (for my girlfriend). The Samsung also has a great screen, and it only costs a third, but the rest of the laptop feels like cheap crap compared to the Mac.
For a "normal" user I would guess using the Mac is a joy. I use Google Chrome as my primary browser, and it works great on the Mac; everything is smooth and snappy. But for a linux user/developer (typically doing a lot more than browsing) things are less joyful.
First of all, OSX seems to require a fair amount of manual mousing, and it really needs more keyboard shortcuts for window placements/sizing. Now there are several nice programs that takes care of this issue: I've used SizeUp which works great (even better than the Gnome Shell, and possibly even Unity which I do not use any longer.
The default setup for Terminal did not work correctly with international charactersets which is surprising. All my systems run UTF-8 by default and I seldom run into charset trouble these days, but when I ran terminal/screen sessions inside the default Terminal program shipped with OSX, my foreign characters were missing. Easily fixed by exporting "export LC_ALL=en_US.UTF-8" in my ~/.profile, but still surprising that this is necessary.
Environment variables is another issue. Setting LC_ALL for shells like I described above is fine, but some tools are typically not run from a shell directly. For things such as IDEs or graphic editors (or other GUI programs), on OSX I typically invoke Spotlight by pressing cmd+space, typing the first few characters of the program name and launch it directly from Spotlight. Some programs use environment variables for configuration. I realize this may not be the "OSX" way, but considering OSX is a kind of Unix (although this is becoming more and more debatable I've realized) and OSX supposedly has great support for open source software (including developer tools), setting environment variables becomes a necessity.
For some reason, setting system wide environment variables on OSX is not an easy task, and seems to become more and more difficult (at least that is what I learned from quite a few google searches). For example, Android Studio is an IDE for Android development. It requires and runs under java. When installed, it needs to figure out where java is on the current system. If it does not find java, it prompts you to download the necessary pieces of java 6. Since I've had some experience with Apple simply removing java from their systems before, I had already installed java 7 from the Oracle downloads. So I was not interested in downloading (and using) java 6 from Apple. This required two things; 1) Commenting out a "java" section in one of the Android Studio configuration files (to avoid Android Studio to prompt me to install Apple's java 6), and 2) Setting the proper JAVA_HOME and ANDROID_HOME environment variables to point to the java and Android Studio installations respectively.
As hinted already, setting system wide environment variables is not an easy task on OSX. Most of the solutions I found was to either modify a launchd XML configuration file (which I simply refuse to do - this supposedly is Unix!), or setting them in /etc/launchd.conf. The latter looked easy, but with one big snag. You can set environment variables there, but their string values can not have embedded spaces in them. Really?? At least I found no workaround for this limitation. Since the default installation location for Android Studio is "/Applications/Android Studio.app", this caused a number of tests and retries before I gave up. No amount of string/shell quoting would allow me to issue the proper "setenv ANDROID_STUDIO /Applications/Android Studio.app" in launchd.conf. So I caved in and simply created a symlink with an underscore instead of space to make it work. Ugly as hell, but it worked.
As you've probably guessed by now, I also do Android Development. In addition to the default java support, it is possible to develop for Android using other JVM-based languages, and I've successfully used Kawa (a GNU Scheme implementation targeting JVM). So my next task was to install kawa. For some reason, Kawa is not as well known or widely used as I believe it should be, which also means installation options are somewhat limited. Fortunately, it does not have a lot of dependencies, so installing from source is fairly easy. Well, except compilation on OSX will fail because the makeinfo executable bundled with OSX does not recognize "UTF-8" encoding and certain tex macros such as "\backslash" (or similar, can't remember which one failed right now). So I could hack the Makefile to avoid generating documentation or find a makeinfo that works on OSX.
Thankfully, the "Homebrew" project make it quite easy to download and install most regular open source development tools, including "texinfo" which contains the "makeinfo" executable. After installing texinfo using Homebrew ("brew install texinfo") and moving the shipped makeinfo executable out of the way (instead symlinking to the newly installed makeinfo instead), kawa compilation (and documentation generation) worked fine, and I had my kawa environment up and running.
Thankfully, Emacs 24 support looks excellent on OSX; I've had no problems with it (at least after being able to set the environment variables that my systems use for finding the proper java system). Although I've mentioned the Android Studio IDE for developing for Android already, I actually only install it to get the Android SDK installed. For development I use Emacs, and after the proper environment variables got set up (to find java), I was able to build my stuff without any problems, including Android native applications and cross platform games using libgdx.
Libgdx is a cross platform gaming library, allowing targeting multiple platforms from a single set of java source code, including Windows/OSX, Android, iOS and HTML5. One of my libgdx projects is an math game for kids. The core game and gameplay has already been implemented, but the graphics is fairly crude. For design work (sketching, GUI design) I use Inkscape. Inkscape supposedly runs on OSX using the Xquartz X11 server. I say supposedly, because at first it looked like it worked just fine. There were some oddities like Inkscape (or the X11 stuff) sometimes seems to "pop" in front of my browser windows for some reason. However, aftering spending an evening with filters in Inkscape to get that perfect woodlike texture (using the turbulence filter), when I loaded those up in Inkscape on OSX, my perfectly tuned wood textures suddenly had distored graphics (embedded black lines). I tweeted about it:
I haven't found a simple solution/workaround to this problem yet, and until I do I will have to consider Inkscape support on OSX "fairly limited".
So to summarize; Mac laptops are great, but open source software support is somewhat limited and quite often the build process needs to be tweaked to make things build and/or run. Since iOS is a significant platform in the world, I still need a Mac laptop to be able to build for iOS, but based on my latest testing I am still not able to use a Mac laptop as my primary development system. My next development laptop will most likely still be a "generic" PC with a great screen and Intel-based ("no-fuzz"/great driver support) graphics. Hopefully somebody will be able to build something flat with great linux support, with a great keyboard and touchpad. ;-)