Linux: still better for coding Wednesday, 04 November 09

Something like one year ago I switched from Linux to Mac OS X. It was not an easy switch if you think that my desktop on Linux used to be this one, that is, just fvmw2 with a minimal configuration, super fast virtual desktop, border-less windows.

Why I switched after more than 12 years of Linux? Actually I didn't decided to switch, just I got a macbook because I wanted to hack a bit with the iPhone SDK and with Mac OS X itself. I installed Linux and Mac OS X in multi boot, and for a few weeks the user interface of Mac OS X was impossible to use for me. But after a few more weeks I was using only Mac OS X for everything.

For the first time I had a system that was working out of the box in all of its parts, it was a good desktop experience with consistent behavior. Screen sharing was cool when working with remote people, no need to hack configuration files or to check why my webcam was not working. To try new programs was as simple as downloading the disk image, opening it, and click on the icon. And.. as optional, the system still usable and responsive while it was performing a lot of I/O! Not something Linux users are used to see.

Note that I'm not the kind of guy that don't want to hack with the system he is using. I even wrote, my drivers, in the past. But it was years ago and I was still willing to trust that Linux after all was young and that it was improving in the desktop side. Now enough is enough, with my computer I want just to focus on what I'm doing without spending hours trying to fix unrelated desktop stuff.

The strength of Linux, or why Mac OS X is weak as development environment



When I say environment I don't think about an IDE or something like this. I used to program with a terminal and vim, and I still code this way on Mac OS X, so in this respect nothing changed. What I'm missing are a number of important tools that made the Linux experience so much comfortable. So here is my list of what's wrong with Mac OS X, or if you want to read it the other way around, of what is cool with Linux.

Valgrind. If you are serious about writing C code you can't live without valgrind. Valgrind turns you into a better programmer. The code you produce is times more reliable after you discover this tool. It is invaluable, and guess what... it started to be usable for Mac OS X only lately, then Snow Leopard came and broken everything already. There are patches that make it barely working with issues (AFAIK things will get better when the new source code of Darwin will be relased), but, this is one of the most important tools of a C developer together with the compiler, it must be rock solid.

Apt-get. Homegrow, Fink, and alike, are great tools, but seriously, they are no way as cool as the apt-get in a good distribution like Debian or Ubuntu. You can find tons of libraries, full systems, with perfect dependencies, fully managed by people that are serious users of this projects, that will tell you that something changed in this new release when you upgrade, "do you want to automatically fix your old config file?" or things like this.

And... the coverage of tools is impressive. From the mainstream to the almost unknown library, there is almost everything. Want the GD lib for Tcl? There is. Want an old release of a lib? Sure. Documentation, full application servers, everything. I can turn a freshly installed Debian system into a production server with everything inside to run a web application in one hour or less (every system administrator can). It's wonderful. And guess what? Developers need to simulate the systems they are developing for, in short time and without too much efforts in order to be productive.

API stability. Mac OS X API, excluding the POSIX calls, change simply too often for my tastes, and there is nowhere the same amount of information you can find about Linux. For instance I compiled nmap yesterday for snow leopard, and guess what, it was not working, unable to open the interfaces. The compiled binary I downloaded from insecure.org worked against the loopback interface but not against the wifi one. The interface to capture raw frames from the airport extreme changed again with snow leopard, breaking valuable programs like Kismac. It's not an open platform so this changes are even worse.

/proc filesystem I know Mac OS X exposes similar informations in other ways, but I sincerely miss the proc filesystem, it was a quick way to explore what was going behind the scenes without having to remember hard-to-remember names to grep.

Compiler. Don't know why but gprof does not work with the standard GCC (the one installed by the official Apple SDK). Tried to compile applications with --arch i386 too, still not working. I bet there is a trivial way to fix it, didn't googled, but it's not OK profiling does not work out of the box with the official compiler.

This are the things that I'm remembering just now, but there are more, little problems that I encounter in my everyday programming experience with Mac OS X that I didn't had with Linux. I still continue to use Mac OS X as my first development platform because while I code I also want a good desktop to surf the web, tweet, chat, and so on, but in order to do my paywork (that's about web development mostly) and my open source development with Redis I've to use a Linux box constantly in order to be more productive.

44 comments
home