Moving declarations to their own separate file?

Feb 18, 2014 at 2:51pm
My function declarations are getting quite lengthy and it's irritating to scroll for 5 seconds to get from a declaration to another...

Is it possible to put each function decl. in its own file, WITHOUT having to deal with scope issues and such?
Feb 18, 2014 at 3:11pm
Yes, just put it in a separate file and include it in the original.

#include "lalala.foo" is going to take the contents of lalala.foo and insert it on the same line.
Feb 18, 2014 at 3:43pm
That worked great, thank you!
Also, just wondering, is this considered good practice?
Feb 18, 2014 at 4:27pm
Do you really mean declarations? Or are you talking about the definitions of those functions, too?

Because if it you've got so many functions that it takes you that long to scroll through just their declarations, then you desperately need to break up your program into sensible modules.

Are you talking about free functions, or methods of a class?
Last edited on Feb 18, 2014 at 4:27pm
Feb 18, 2014 at 7:00pm
is this considered good practice?

It really depends on what exactly you put into that included file.
Topic archived. No new replies allowed.