In programming other languages over the years I have tended to a minimalist style of programming which I find myself doing now as I am learning Objective-C.
For example, I would write...
Instead of...
Obviously here I have no intention of using processName or processIdentifier anywhere else in the program. I tend to do this a lot.
I am wondering if I am setting myself up for problems later on with regard to garbage collection or perhaps something else. If garbage collection is an issue, will using the Garbage Collector keep me out of trouble?
Thanks,
John
For example, I would write...
Code:
NSLog(@"Section 2\nName: %@ Process ID: %i\n\n", [[NSProcessInfo processInfo] processName], [[NSProcessInfo processInfo] processIdentifier]);
Instead of...
Code:
NSString *processName = [[NSProcessInfo processInfo] processName];
int processIdentifier = [[NSProcessInfo processInfo] processIdentifier];
NSLog(@"Section 2\nName: %@ Process ID: %i\n\n", processName, processIdentifier);
Obviously here I have no intention of using processName or processIdentifier anywhere else in the program. I tend to do this a lot.
I am wondering if I am setting myself up for problems later on with regard to garbage collection or perhaps something else. If garbage collection is an issue, will using the Garbage Collector keep me out of trouble?
Thanks,
John