Saturday, September 15, 2007

Mac OS X applications

I used to be a huge fan of Apple stuff. My first Apple system was an Apple II (because the Mac was too expensive at the time). Eventually I got myself a Mac LC, right after that almost-unknown Apple IIGS (which was an Apple II that looked like a Mac --it had a mouse, it had QuickDraw and all). And then, at work, everyone had Macs. There were also a couple of PCs lying around.
Then one day, I needed to compile something on one of those PCs (it was running NT 3.51beta at the time). And, oh my god, the compilation of that C program took just a few seconds. Why did it take 10 minutes on my Mac? It was, at the time, a good-enough reason for a divorce. Windows was going to be my love, and it has been ever since.

Fast-forward to 2007. I still use Windows systems at work (XP SP2). I still use Windows systems at home (we have a Media Center, a laptop running XP, and another running Vista). And life is great. But... for some reason unknown to me (nothing new in the near future? the new iMacs?), I started looking at Macs, and at OS X for the first time in years. I am even thinking of finding good reasons to actually go and buy one.
So here is one thing I discovered recently, after watching a nice demo of Mac OS X Tiger (thanks to Google Video, although for some reason that video is not available anymore today): it is much more natural to deal with applications on the Mac than it is on Windows!

An application is usually installed by launching a package (this is similar to what you have on Windows with the Windows Installer). Once the application has been installed it usually appears in you Applications folder. You may create aliases (shortcuts in the Windows world) that you may put anywhere (including the Dock) to launch that application. Deleting those aliases does not delete the application (exactly as on Windows).
You may also move the application from the Applications folder to any other location, and its aliases will still run properly. Deleting the application only involves putting it in the trash can.
In that description, one thing stands out: the application is just one file.
On Windows, an application usually consists of several files: an executable, a few DLLs, and more (plus a few registry entries). On the Mac, it's just a file. Which means people cannot screw it up.

This is where I started thinking: how can it be just a file? On Windows, with .net, you get to something very similar: no need for registry entries, an executable or a DLL may actually contain resources (i.e. other files, like icons or strings of text), so an installation just means copying those files, and they should presumably be movable without any issue. But you still have a few files though (if only as a packaging convenience for the developers).

How do they do it on the Mac? Either it's the same as .net, but taken to the extreme (one file contains everything), or the Finder fakes it...
This article gave me the solution: indeed, the Finder fakes it. And it's very nicely done.

1 comment:

Terry Kaufman said...

If I had the money, I would definitely buy an Apple. It is only a dream for the time being.