discuss-gnustep
[Top][All Lists]
Advanced

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

Re: empty document at Graphos startup


From: Ivan Vučica
Subject: Re: empty document at Graphos startup
Date: Mon, 19 Dec 2011 20:39:58 +0100



On Mon, Dec 19, 2011 at 18:50, Wolfgang Lux <wolfgang.lux@gmail.com> wrote:

BTW, I've noticed this bogus code in the -init method:
   [super init];
   if (self)
This should read
   self = [super init];
   if (self)
or more compactly
   if ((self = [super init]) != nil)
 
Or even more compactly:
  if((self = [super init])

I'll go a bit more offtopic... 

To be honest, I find the following the nicest style, since the body of the initializer is on the first level of indentation, not on the second level:

//////
self = [super init];
if(!self)
  return nil;

// body here

return self;
//////

--
Ivan Vučica - ivan@vucica.net



reply via email to

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