Dot syntax


#1

I’m so glad that this book does not rely on dot syntax. Code is so much easier to read for a newbie when written as messages and not the dot stuff. But, Apple engineers write largely in dot syntax.

My question is, how would you write the stock Apple code to move it away from dot syntax:

Thanks much,

Brad.


#2

//self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]]; [self setWindow:[[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]]];

//self.window.backgroundColor = [UIColor whiteColor]; [[self window] setBackgroundColor:[UIColor whiteColor]];

//[self.window makeKeyAndVisible]; [[self window] makeKeyAndVisible];
This is confusing to me also. With dot syntax, I have a hard time figuring out if I’m accessing a C structure or a property.


#3

Thanks very much. That is sooooo much easier to read. I can’t thank the authors enough for getting away from dot syntax. To me, dot syntax obsfucates the beauty of the language, which is designed to be more readable.