Object-oriented programmers: what is your process when you're physically coding?
When you’re writing new code and you’ve got either a mental model or something sketched out on paper, and you’re physically typing the code, you end up constantly referring to things that aren’t yet built.
For example, I might have a model ObjectA that I’m starting the project with, and while writing a method for ObjectA, I know it needs to call a method I haven’t written yet on an instance of ObjectB which is of a class that doesn’t yet exist. Do you immediately stop writing ObjectA’s method, create the file for the ObjectB’s class, and stub in the method declaration? or do you finnish the original method you were working on? Once you’ve finished the method for ObjectA, do you continue writing ObjectA’s methods, or do you jump over to your ObjectB’s file and complete the method you defined?
The whole process is so non-linear and schizophrenic that I sometimes loose my “flow” and my mental compass get’s turned around. In a way, it’s a bit like a depth-first search vs. a breadth-first search problem. Is there a term for this dilemma in the industry that I could use to search for more info? Are there commonly accepted best practices? Are there some good resources that cover this topic out there? Any practical advice from your experiences?
Additionally, you can’t compile the app until your code is roughly complete, so this can force you to complete dependancies that you were intending on working out in the future. This is frustrating because you can’t compile as you go to verify things are working properly.
This question is in the General Section. Responses must be helpful and on-topic.