I'm still very new to programming and I want to write the cleanest code possible.
This may sound like a silly question, but what order should I put my methods in? Functionally of course it doesn't matter, but layout it makes a huge difference. So say we have the following code in one class:
-(void)testCreateProjectWithStartDate {
[self setUpTestCreateProjectWithStartDate];
...
}
-(void)setUpTestCreateProjectWithStartDate {
testMOC = [self setUpInMemoryStore];
[self mockOutXMLStoreForInMemoryStore];
}
- (NSManagedObjectContext *)setUpInMemoryStore {
...
NSPersistentStoreCoordinator *coordMock = [self pscMock];
...
}
- (NSPersistentStoreCoordinator *)pscMock {
...
}
-(void)mockOutXMLStoreForInMemoryStore {
...
}
Do I have the methods ordered in the order that they are called? What if a method is called from two places within a class?
This code snippet looks a complete mess to me - it's very confusing to have to skip about as much as this just to figure out what is a very simple flow.
What order of methods would make more sense?