gnustep-dev
[Top][All Lists]
Advanced

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

Re: @property coding style


From: David Chisnall
Subject: Re: @property coding style
Date: Sat, 28 Jan 2012 12:44:41 +0000

On 28 Jan 2012, at 12:34, Ivan Vučica wrote:

> Hi all,
> 
> Amr has used some Objective-C 2.0 features in QuartzCore, such as @property. 
> What's the status on use of 2.0 in extra libraries in GNUstep? Should I work 
> on changing all that to manually implemented methods?

The decision at FOSDEM last year was that UIKit can use Objective-C 2 features, 
as there is no legacy Objective-C 1 code that uses UIKit, so anyone wanting to 
use UIKit is already restricted to an Objective-C 2 compiler.  

All of these features have been working with Clang and the GNUstep runtime for 
a while, and they should also work with GCC 4.6.

> Am I required to use macros such as AUTORELEASE() or can I directly call the 
> -autorelease method?

The AUTORELEASE() macro is an ugly hack to remove -autorelease calls when using 
the old Apple-incompatible GC mechanism.  The cost of not using them is just a 
few message sends that do nothing.  Unless it's really performance critical 
code that is expected to run in the old GC mode, I wouldn't bother.  They 
obfuscate the code and make it harder to read static analyser warnings.

> Also, I feel more comfortable using my own coding style when it comes to 
> indentation and stuff like that. For libraries where I feel I might be doing 
> major contributions, can I use my own coding style, or am I absolutely 
> required to use the GNU coding style?

More difficult to say.  The runtime uses the Étoilé coding conventions, which 
are actually sane, but for any contribution to base or gui I try to stick to 
writing obfuscated code^W^W^Wfollowing the GNU coding conventions.  

The most important thing is consistency within a project, so if the library 
already uses one set of coding conventions then it's best to follow it, rather 
than mix and match.  

David

-- Sent from my brain




reply via email to

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