I have a program that I am writing, not too big. Apart from the main function, it has about 15 other functions that called for various tasks at various times. The code works just fine all in one file, and as it is right now.
However, I was wondering if anyone had any advice on whether it is smarter/more efficient/better programming to put those functions in a separate file different from where main is, or whether it even matters at all. If yes, why? If no, why not?
I am not new at C++, but definitely not an expert either, so if you think this question is stupid, feel free to tell me so.
Thanks for your time!
Depends on how big those functions are. If your source file starts to get over several hundred lines of code in length, there is reason to extract part of the functionality into one (or more) separate file(s).
If you can group the functions into distinct sets based on their responsibilities and/or their level of abstraction, you may prefer separating them into distinct physical files (and classes of course) along those lines. E.g. some functions may work with file I/O while others do some computation. Or some functions do low level bit flipping chores within file I/O, while others build on the former to implement some more abstract functionality.
Another reason to partition your code would be if some of the functions were used by more than one client, but this apparently does not apply to your case. (However, this is probably going to change if / as your app is further developed and extended in the future...)