Good day everybody (!)
My App is a one window program. I have a Main.cpp file and a MainComponent.h file, the usual stuff according to the basic Juce Tutorials.
MainComponent is getting bigger and bigger though. From 500 to 2,000 code lines. I figured out how to create ‘different scenes’ based on a single window by way of displaying on-and-off different Components, using paint() along with if, else if… conditionals - and so on. This enables me to keep expanding the code at MainComponent with no trouble. I realized that the system can continue to grow -adding more features- almost endlessly… and using a single window only!
During the last days I reached the 6,000 lines of code mark. My question to you: Is it wise, is it a good idea to continue growing the program this way? At what point is it advisable to think about some form of restructuring, perhaps splitting the file into 2 or more -more manageable- separate files?
Last but not least, how do you split a large MainComponent into two or more files? Is it even possible? I have the feeling that splitting the file into several files is very difficult–since the different sections, like the constructor, paint(), resized(), object declarations, your own routines, etc. are highly interdependent.
Thank you (!)