Newbie Mac Programmer Hints
People occasionally tell me that they want to learn how to program
the Mac and ask me where they should start. Well here's my list of
things to do, in no particular order:
- Read "Macintosh Human Interface Guidelines". This is the first
step for anyone attempting to program a Mac simply because it gets
you into the spirit of Macintosh.
- Discard old ideas. If you've programmed GUIs before this won't
be a problem, but if you've been a CLI programmer you will need to
completely rethink how your programs are written. There
is no stdout on the Mac, everything is event
driven, all your programs turn upside down.
- Read (new) "Inside Macintosh: Overview". A very good
introduction to general Mac applications.
- Investigate real high level languages. I've done a lot of Mac
programming in HyperCard and, while it's not fast and it limits
you HI, it certainly is a big productivity win. At the moment I'm
investigating FaceSpan as a replacement but there are lots of
other tools around, eg SmallTalk Agents and Prograph.
- If you insist on programming in a low-level language, use
Pascal (-: If you're not going to use Pascal, make sure you
understand the difference between C and Pascal calling conventions
and strings because they will haunt you throughout your
development.
- If you intend to program in Pascal, C or Java, use the
Metrowerks CodeWarrior
development environment.
- If you're working an a full blown Mac application, find and
use a class library. Keeping up with all the various aspects is
too hard for mere mortals these days. But if you're just working
on a simple utility, eschew the class library 'cause the learning
curves are pretty steep. If you program enough small utilities
you'll eventually generate your own libraries, possibly a better
solution all around.
- Darko's Maxim: Set your ports and lock your handles.
- There is no point 9.
- Get a CD ROM drive and a copy of the following CD ROMs:
- Apple Developer CDs, which you get by joining one of the
Apple developer
programmes. At the lowest rate, this is relatively cheap
and the CDs are definitely worth it.
- Inside Macintosh CD, about $150 and saves your bookshelves
from undergoing gravitational collapse. While this was
published a few years ago -- and thus doesn't have all the
latest information -- it is a very cheap entry point and I
personally prefer the viewer on this CD (Apple DocViewer) to
the viewer on the Apple Developer CDs (Acrobloat).
- Apprentice CD ROM,
for it contains many useful source code examples that will
literally save you hours of work.
- Make use of new technologies. If you need to do complicated
I/O programming, use the Thread Manager 'cause it really does pay
off. If you're writing networking code, use Open Transport becasue
it's easier. Don't try to support System 6. If you're program
needs Colour QuickDraw, compile it for the '020 and above.
Many of these ideas are blatantly plagarised from Peter N Lewis'
FAQ entry on this subject. In
turn, many of the ideas on this page have been blatantly plagarised
by the Apple Developer Support
Introduction To
Macintosh Programming page, which is OK 'cause I helped write it.
Quinn "The
Eskimo!"
20 Jul 1998