discuss-gnustep
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: clang vs gcc 4.7


From: Wolfgang Lux
Subject: Re: clang vs gcc 4.7
Date: Mon, 4 Mar 2013 21:16:51 +0100

Riccardo Mottola wrote:

> Hi,
> 
> On 03/03/13 13:17, Richard Frith-Macdonald wrote:
>> My take on the relative merits is:
>> 
>> The advantages of gcc are that it's the de-facto standard (you generally 
>> don't have to install it, let alone build it yourself), is much more 
>> portable/ported (reliable on many more platforms), and has most of the good 
>> things that Apple has added to objc, and less of the the bloat such as 
>> 'blocks'.
> +1 ! If yo udon't use something, why do you need support for it?

Gosh, what a gross misconception! Not blocks (aka closures aka lambdas) are 
bloat but the workarounds that had to be introduced in their absence. A typical 
example are all those callbacks for the AppKit methods presenting non-modal 
dialogs. Blocks are the natural concept for those callbacks. Passing around a 
selector and void * context argument instead of them is a poor workaround (and 
introduces code bloat as you have to create those context parameters, extract 
the components later, and must not forget to properly retain and release all 
your arguments, and I won't mention the loss of type safety by using a void * 
parameter together with type casts). It is really a pity that it took Apple so 
long to bring this essential Smalltalk concept over to Objective-C (and the 
only excuse is that it requires some form of automatic memory management -- be 
it full garbage collection or automatic reference counting -- to be manageable).

Saying blocks are bloat sounds to me like saying automatic reference counting 
is bloat because you can do the same with explicit retain/release calls.

Wolfgang





reply via email to

[Prev in Thread] Current Thread [Next in Thread]