Re: cross-platform audio software dev
Re: cross-platform audio software dev
On Sat, Dec 27, 2008 at 01:31:19PM +0000, Hamish Allan wrote:
> On Sat, Dec 27, 2008 at 2:32 AM, Marc Vaillant <email@hidden> wrote:
>
> > In what way is it less natural? I think that John has the right idea
> > here. One can likely write cleaner, more maintainable interfaces (not to
> > mention core implmentation) for their code in C++ than C that can easily
> > be bridged to objc via objc++. More natural? I don't know, but
> > certainly better programming practice.
>
> In my opinion, coding in Obj-C++ is not particularly natural because
> C++ and Obj-C objects cannot be used interchangeably.
Well, other than toll-free bridging you can't with C objects either. I
doubt many people are building C interfaces and toll-free bridging
them to objc.
>
> If you think that interfaces in C++ are cleaner than those in C, why
> do you suppose Apple chose C for Core Foundation?
I have no idea. I--like many others I'm sure--avoid CF when I can. Every
OOP like C interface I've tried would have been much better had it been
written in a proper OOP language. Good C++ interfaces result in
safer, more maintainable code. And by using inlining and templates, for
example, you can write C++ code that pays little to no penalty over C.
>
> > Why keep someone from using C++ simply because it will be bridged to
> > objc in one port of the application? If you have some aversion to
> > objc++, then your high level API can be C around your C++ if you really
> > want.
>
> Sure, and for all I know, Apple have written the guts of CoreAudio
> (phew, back ontopic!) in C++ and simply presented a C interface to it.
> I don't much care, as long as I don't have to use Obj-C++. I don't
> mean to "keep" anyone from using C++ for their back-end; I just
> wouldn't put it in the same class as C for platform independence.
Every C compiler I can think of is also bundled with a C++ compiler.
I don't see that forcing someone to use C++ instead of C would be a
limitation, because in general the interfaces will be significantly
safer to use. Here's what the bot over at ##c at irc.freenode.net (I
repeat, this is ##c NOT ##c++) has to say about the purpose of C:
"c is a low level language designed to make assembly "easier", useful for
device drivers or operating systems. Thusly, one has to maintain
buffers, memory, and various low level information. C is not meant to be
used for everyday applications, a common misconception."
Let me say that I love Obj-C and I'm sorry to have gone way off topic
here but when I hang out in mac dev places including #iphone-dev and
#macdev, I hear a lot of C++ bashing by people who haven't given it a
chance. It was invented by a smart person and is used my many smart
people. At the very least, it is to be respected.
Marc
_______________________________________________
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