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: "Pierce T. Wetter III" <email@hidden>
- Date: Mon, 13 Mar 2006 09:57:26 -0700
On Mar 12, 2006, at 4:02 PM, cudrnak wrote:
Hello all,
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? 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.
Having been down this same path about 8 years ago I'll answer.
Objc/Cocoa is the way to go, dive right into bindings and don't
look back.
Bracket Syntax:
Yes, [] syntax is annoying at first.
But it takes your brain less time then you think to adjust from:
object.call().call().call()
to
[[[object call] call] call]
Realize that the bracket syntax has plusses and minuses.
The major plus is that method calls are by and large self-
documenting. In C++ and Java, you have to remember which parameters
go in which order because people name their methods things like:
object.doStuff(,,,,)
So its a trip to the docs to lookup what order things go in.
In Objective-C, that becomes:
[ object doStuffWithTheWindow: window
theView: view
anImage: image
aPoint: point
aRect: rect
aColor: color]
I didn't believe this when I first started with ObjC, but now I
do, because its annoying for me when I poke at our data model using
pyobjc, and have to lookup all the parameters to every method again...
XCode has built in "completion" which means it can often provide a
template for you to fill out if you can remember what the first few
letters of the method call are.
Categories:
If you're a C++ mule, you're probably intimately familiar with
the fragile base class problem.
Much, much harder to get into that situation with Objc because
you can add methods as needed to existing classes. If you look at the
sample code out there, all of them add a whole set of utilities to
the Apple base classes.
Bindings:
As a WebObjects hacker from way back, bindings add a much needed
simple glue structure to the UI framework. In brief, bindings let you
make a two-way connection between UI objects and your data.
Pierce
_______________________________________________
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