Alloc and Init


The book specifies that


are the same. I understand one is meant for convenience but is one way better practice than the other?

I am also curious whether nesting a message or not is better practice. It just says that nesting is more difficult to read and decipher.

Awesome books and thanks in advance for the help!


Both should do the same thing.

You should also be able to do:

NSDate *now = [NSDate new];
However, since the first one is more explicit, one can argue that it is a better choice.

Nesting makes the code more difficult to debug by hand or by using the debugger.

However, nesting alloc and init… methods has become the norm.


I think it’s by pure coincidence that the init method also does what the date method does? (return the current date)