The week-end came suddenly again. It's Sunday night and the time to
write something for the site has come. Moreover, having in mind that the
last time I promised to keep the regularity. Well, it's promised only
for the Russian version, because I also need time to translate the stuff
into English, and sometimes I don't have it.
It was a time when every evening before falling asleep I used to ask
myself on results of the day's activity. That's how I was saying (not in
aloud, of course): "Konstantin, tell me sincerely, what have you done
today? Have you become better, smarter, reacher, happier?". It looks
like now the old practice passed away and the question became weekly.
Nevertheless, it didn't become less topical.
The strongest impressions during this week I got from the Apple
Macintosh platform. I was developing one of our products for it.
Recently I'm just like marshal Zhukov (see the WW2 history), sent to the
most critical sectors of the front. Just got used to Windows, launched a
release, and now I'm on Mac. On two Macs, actually. With several OSes.
A Quick Glance At Macintosh
Those of you who believe that Macintosh is something great, nice and
bright, are most likely not have seen it. Or another variant -- haven't
seen anything but Mac. Till now I've been hearing opinions that Mac is a
white computer made for white people, perfect in every respect and for
all the tasks. Well, it's not bad at all, but I wouldn't idealize it.
Let's start with the hardware.
The exterior design aspect of hardware pieces such as case and keyboard
is definitely better than the one of PC. At least, it's more pleasant to
look at them. Smooth edges, semi-transparent material, logotypes on the
sides, etc. As to the mouse, there can be objections, for the poor
animal on the Mac computers has only one button. The operation normally
invoked with the right button on PCs is done here with a mouse click
with the ctrl key being held. The case is usually opened in a very
interesting way, -- like a sideboard, there is a side with a motherboard
sticked to it. A very useful feature. Mouse is connected directly to the
keyboard, actually it's plugged into one of the two USB ports on it. The
ports are sutiated from the both sides so that it's possible to use a
left handed mouse as well as the right handed one. Among disadvantages
there is a short cable between keyboard and the case, due to which it's
impossible to put the computer under the desk.
There are much more various nice things like a pulsing power button on
the case when the computer is on. Obviously the price the computer is
sold for quite allows the company to spend some money on the device
look. Mac is not such a cheap thing, a used PowerMac G2 cost us in
Canada about $800. And the newer models look even nicer. Well, just like
their price. On the Apple web site there are some pictures.
As to the GUI usability of Mac OS X, in my opinion, the task bar and the
launch panel are a bit confusing. Like, when an application is running,
you can see a black arrow next to its icon. At the other hand, windows
open by applications are minimized into the task bar. It would be easier
to see all the applications beging ran in the task bar, and not to be
mixed with the shortcuts list. Because if there is application running,
without any windows open, you see only the black arrow and no items on
the task bar. Though, it's a matter of habit. At the other hand, if the
Macintosh guys don't do anything about the finder application, in the
nearest future the majority of Mac OS X users will be squint-eyed.
Because now, when you click on a directory its contents are shown to the
right, and the control moves there smoothly (sic!).
Software
Before Mac OS X appeared, the market of Macintosh software looked very
sadly. Everything, including very minimal utilities needed to be bought
particulary. Even now from time to time you have to download various
trial versions. Archiver, ftp client.. Sure in Windows it's almost the
same, though there is quite a lot of freeware. Like in Windows, a web
browser is included into the Mac OS distribution. The funny thing is
that it's the same M$ Internet Explorer.
Actually, there is a reason why I said "before Mac OS X appeared". The
point is that the recent version is based on the BSD standard, and even
has some sources of a BSD compatible system underneath. This means there
is a possibility to use various free software. Fortunatelly, a separate
CD which contains whole the GNU tools package, including compilers,
make, auto-tools, etc. But there is no lack of problems too. Like, there
was a real situation when I wanted to archive a directory containing
program sources. It wasn't meant to be something difficult, huh? Since
there was no native archiver application with GUI included into the
system by default, I decided to use a command line zip. So, I archived
and sent it. Everything unpacked well on remote, but resource files
coudln't be open anymore, they were of zero length. When I archived and
unpacked the same stuff locally I got the same situation. WTF? After
several minutes I understood the reason. I tried to look at the files
from the command line, using tools compiled for Darwin. According to the
ls(1) output, their length was zero. At the same time, the resource
editor application could open the files, and the Finder was showing some
size as well. Due to the same thing, it's impossible to use the command
line cvs(1) normally. Here I had to switch to a graphical front-end for
this versions control system, which was doing some conversion "on fly".
Archives I had to make with the help of a trial version of StuffIt (a
special Mac one), because the real length of resource files can be seen
only by the following three applications: Finder, MacCVS and StuffIt. I
still cannot get why it's so. Maybe there is someone to explain such a
behavior?
Development
As far as I know, there are two development environments for Macintosh.
They are Project Builder by Apple and CodeWarrior by
MetroWerks. Both are quite specific, but not too difficult to get used
to. Our company prefers the latter, thus I had to get a clue with it.
The most weird part of it was the Project Settings dialog which took me
most of time to comprehend. Making a big step from Mac OS 9 and the BSD
based Mac OS X the Apple guys took care of compatibility issues on the
code level. This means that it's quite possible to make a program run on
the both versions of the OS. It's usually done by linking against a
special library called CarbonLib. The process of such a porting in
called carbonization respectively :) Sometimes besides linking you
should modify the code too, because not all the calls are not
compatible, and in some situations the library behaves different on
different OS versions.
A need to connect help to a program for Mac turned out to be quite an
adventure too. For some reason, I used to think it was enough just to
include something into the distribution and then run a special program
giving that something as an argument. I was too naive, because in order
to connect help to an already written program first you have to build it
as an application package. Package is not a usual binary, but a folder,
in which it's possible to add various files, including the ones of help
format. The location of the help is defined by so called properties
list, another file in the package. There you must write something like:
the "John Doe" folder contains help. The next step is setting up File
Specifications in the project settings. There is a need for two
additional records for .html and .plist extensions, saying they are to
be included into the resulting package. That's it, once done, you can
expect the standard "(application name) help" item to appear in the menu
bar. Of course, it's all about the uniform approach to the applications'
architecture, but it looks quite weird anyway.
One more interesting thing was discovered in the process of implementing
the help. As soon as I switched the application type setting to package,
a strange error message started appearing during the linking phase,
saying "The classis application chosen is not inside the package folder
tree". But then the program worked with no problem. Though the error
made debugging impossible. First I thought there was a problem in the
project settings. But then found out that the problem could be solved by
installing a couple of updates for CodeWarrior.
In order to understand how the GUI applications for Mac are made, it's
be enough just to read some docs about the PowerPlant library and to
take a look at several examples. In comparison with MFC there will be a
need for more manual coding. Nevertheless, from the programming point of
view the GUI is not more difficult than in Windows.
Versions
In order to check whether the program worked on different versions of
Mac OS I had to have two operating systems installed on my Mac. That's
when I first saw Mac OS 9. I liked the mechanism which made it possible
to install different OSes on the same partition. The feeling you have
after botting into Mac OS 9 right after Mac OS X can be described the
following way. Imagine you have just had sex with a fat and limping
chick, almost without breasts and with a pimply face. Why you did it,
better ask yourself, have-been. Then another girl comes. She looks like
a dream and says that since this very moment she will replace the chick
for you. The same way you feel after a weird and morally outdated
interface of Mac OS 9, when booting into Mac OS X and seeing all of
those transparent windows, rounded buttons, and other beauty. BTW, on
the same hardware the Mac OS X GUI works faster.
As for the rest, the Mac is very similar to PC. Programs sometimes
crash. Fortunatelly, the whole system hangs rather rarely, but it
happened to me several times. These are standard disadvantages of any
computer and software for it made by people, and people are not perfect.
The same way, being just a computer (and not a bad computer), Mac is not
perfect either. A subjective conclusion of mine -- it's good to know how
to program for it (like every other thing, it's better to know than not
to know), but personally I don't see any reason why I should perefer it
to PC. Just an expensive computer for aesthetes.