Re: red black trees
Re: red black trees
- Subject: Re: red black trees
- From: Glen Low <email@hidden>
- Date: Wed, 25 Feb 2004 20:18:28 +0800
On Feb 19, 2004, at 5:11 AM, Allan Odgaard wrote:
On 19. Feb 2004, at 11:29, Marco Scheurer wrote:
Arg... implementing algorithms in ObjC is certainly not something I
would recommend, not really for the performance overhead, but mainly
for the syntactic overhead [...]
Argh! I would have said exactly the opposite, ie one always want to
avoid the syntactic mess of C++. [...]
Not that I wish to start a flame war or anything, but would you care
to elaborate?
C++ operator overloading is succinct, and where there is a intuitive
analogy between the type and numbers, it works well. ObjC syntax tends
towards verbose in Smalltalk style, especially with "named" params --
however named params can be a win in code clarity with lots of params.
C++ has good RAII technique which alleviate a lot of the memory
management hassle (and or danger) of ObjC, as well as avoiding a lot of
the autorelease, release etc. visible in ObjC code.
I think C++ has gotten a bad rap for its unwieldy template syntax,
which is more of a pain to define than to use. It means it is 10x
harder on the library writer and perhaps 2x easier on the library user
than ObjC.
Yet a lot of the flexibility you get with ObjC -- dynamic dispatch,
informal protocols, KVC, etc. -- would be difficult to achieve in C++
(or even in the more "dynamic" languages like Java and C# which were
still stuck in a pre-generics C++ OO-only mindset until very recently).
Cheers, Glen Low
---
pixelglow software | simply brilliant stuff
www.pixelglow.com
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.