Re: Objective C and C++
Re: Objective C and C++
- Subject: Re: Objective C and C++
- From: Kevin Boyce <email@hidden>
- Date: Wed, 24 Dec 2008 15:10:12 -0500
On Dec 22, 2008, at 2:41 AM, Brian Willoughby wrote:
But Apple can still take your advice to heart. More Standard C
examples would be helpful, since they could be incorporated into C++
or ObjC without necessitating so much in-depth knowledge of the
"other" language. Also, if Apple were to provide more ObjC examples
for the C API like CoreAudio and CoreMIDI, then new programmers who
are learning C and ObjC for the first time would not have the
additional burden of learning C++ and how to break out the Standard
C lines from the rest. There is a big market for new programmers
learning Cocoa and ObjC, so the focus on C++ examples can be a
serious hurdle.
I heartily concur! I don't do much programming in my day job, so I
made the choice many years ago to attempt to pole-vault from C right
over C++ to whatever came next (since C++ looked, and still does to my
eyes, like something even easier to shoot your own feet with than C).
I thought the next one might be Dylan, but that didn't work out too
well. Then I decided to write some stuff on my own, by which time Obj-
C was the new language. Took about a day to get the hang of it. (And
a little more to figure out AppKit et al!) Obj-C is an easy language
to learn, IYAM.
So here I am, fluent in C and Obj-C, trying to use core audio, and I
keep running up against my non-understanding of C++. Mostly it's
straightforward, and eventually I figured out the syntax for
constructors and stuff, so I can at least read the CAxxx code. But
there are some things Apple could do that would really help.
One thing. Create some Obj-C wrappers to handle the Public Utility
stuff. CAStreamBasicDescription, AUOutputBL et al are really nice to
make sure all the fields are correctly filled, but things like casting
correctly are just different enough in C++ that it's a huge pain.
But before even that: Some kind of organized documentation would be
really really nice. Maybe I'm missing something, but the sum total of
documentation I can find for Public Utility is "+ various C++/Obj-C
code used by some of the examples (and the CA frameworks
themselves!)" SRSLY? I spent hours trying to get AudioFile stuff
working because I accidentally included CAAudioFile.cpp when I wanted
to use extended audio files.
Is there somewhere I should be looking to find this stuff? Even the
basics, like the difference between AudioFile and ExtAudioFile, are
buried in, well, I have no idea where I found that out. Maybe on this
list (and the list is amazing, but it shouldn't be the first source of
info). For a C++ programmer, you can start with various samples and
go from there, but even so the documentation is thinner than a
supermodel on heroin.
Let me put it this way: I'd like to be able to option-click
AudioUnitSetProperty and get some help about audio unit properties,
rather than having to command-click a property name and scan the
header for other properties, hoping there's enough info to use it the
right way.
Please?? If not for this Christmas, maybe next?
</rant>
-Kevin
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Coreaudio-api mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden