Re: What framework & language is good for an old C++ mule.
Re: What framework & language is good for an old C++ mule.
- Subject: Re: What framework & language is good for an old C++ mule.
- From: Scott Thompson <email@hidden>
- Date: Sun, 12 Mar 2006 22:56:42 -0600
On Mar 12, 2006, at 5:02 PM, cudrnak wrote:
I am looking to learn to write software for Mac OS X. I would like
some advice and guidance on what framework to run with. Way back in
1991-3, I wrote Mac code in MacApp using MPW. I have since been
writing object-oriented telecom code for UNIX/POSIX in C++. I've
gone through the tutorials for Xcode 1.5 with Carbon and cocoa/
objC. I can see that the cocoa framework saves a lot of coding
over Carbon, which looks more like the old toolbox stuff. I really
don't want to go down rant road, but I am put off by the
objectionable-C syntax because, to my C/C++ trained eyes, many
things seems like odd ways to define things.
Can anyone suggest a good route for me?
Without knowing a bit more about your interests and goals, it's
really hard to offer advice about which way you should turn. I've
written applications for both environments and find them to be
alternate means to the same end... each with their individual
strengths and weaknesses. What kind of application are you interested
in writing? What OS services do you hope to draw upon?
In your situation, it sounds like the advantage of going the Carbon
route would be your familiarity with the environment, and the fact
that you want to stick with C++. Carbon is definately closer to the
classic Mac OS APIs that you may remember from the "old days",
however there have been quite a lot of changes even in the Carbon
API. For example, the (classic) Event Manager has been replaced by
the Carbon Event manager, the Resource Manager is largely unused in
truly modern applications, the Control Manager has evolved into the
HIView system, and (starting with Tiger) QuickDraw is deprecated.
All in all, these evolutions offer a system that is more powerful,
with a heck of a lot less "boilerplate code". The changes also mean
that while may be able to apply some of your knowledge from the old
days, you still face a learning curve in Carbon.
In terms of the Cocoa learning curve, the syntax of Objective-C is
actually the smallest part of learning to work with Cocoa. The larger
challenges are familiarizing yourself with the idioms of Objective-C
and learning the Cocoa frameworks. You just don't do some things the
same way in Objective-C as you do them in C++. There are design
patterns and other techniques that work well in Objective-C's dynamic
dispatching environment which you wouldn't see in C++ and similar
arguments can be made the other way. Learning any new framework is a
challenge and the Cocoa frameworks offer a rich environment for
exploration. This can be both a blessing and a curse.
Carbon will likely be more familiar to you, but Cocoa has some
initial productivity advantages that can be very compelling. If you
have older applications that you want to bring forward to the Mac OS
X platform, then Carbon is certainly the way to go. For new
applications, however, Apple strongly suggests Cocoa and gears many
of their tools to help making Cocoa applications easy.
Would I have a shorter learning curve with cocoa/Java? Would
CodeWarrior/PowerPlant be a better choice because of my C/C++
background? Personal experience or even just pointers to existing
web pages would be great.
You're not going to have any success with Java and Cocoa, the Cocoa
bridge to Java has been deprecated. Java would be the environment to
aim for if you want to produce cross-platform enterprise software.
I've not seen much user-level GUI software for Mac OS X written in
Java. That which I have seen usually sticks out like sore thumb.
That may just be because I've not looked in all the right places,
though.
CodeWarrior for the Macintosh is no longer a viable product. I've not
heard much about the fate of PowerPlant (but I also can't honestly
say that I've looked into the matter).
While PowerPlant applications continue to run in Mac OS X, the
framework is really geared toward the classic Mac OS APIs. There was
a nascent evolution of the framework directed at Mac OS X (called
PowerPlant/X) but it was just starting to get interesting around the
time that Motorola killed CodeWarrior on the Mac. What's more,
CodeWarrior sold off their Intel compiler when they were acquired by
Motorola so there is no CodeWarrior solution for creating Universal
binaries. Since you asked my opinion :-) I'd leave CodeWarrior and
PowerPlant out of your roadmap.
In terms of C++ application frameworks for Carbon, no clear
replacement for PowerPlant has emerged. At the same time, the
changes to the Macintosh Toolboxes have evolved to be more framework
like themselves. Putting a C++ front-end on that functionality is
pretty darn easy.
Just based on the pinhole glance you've given me into your world, I'd
say continue to give Cocoa a chance. The syntax will seem odd for a
while, and you'll have to learn some new techniques, but if you can
get past that Cocoa can be a lot of fun. What's more (if you're
careful) you'll find that some of the idioms you learn for Cocoa can
have a positive impact on your C++ design.
Nothing says you have to abandon C++. Many of us, myself included,
work on cross-platform applications. We use Cocoa for the front end,
but the business logic of our applications are written in C++.
Scott
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden