I was making a code and I had like 5 include files in there, I was defining functions in this file and then realized why should not I just make separate header files for all the functions and then just include them in a file at last. But, I have seen that this is not done usually. Why not? Is there a particular disadvantage of doing this?
I was making a code and I had like 5 include files in there,
Share
This is not a real answer, because the question has a wrong assumption:
This is not true. This is a common practice. A good example is ffmpeg.h. The header is a front-end to an extensive library.
The argument of long compilation times is bogus. Today the systems are very fast. This is only important for really huge systems, but I really don’t think that you work with them. I never encountered such systems myself.
And compilation times aren’t execution times. This is another misconception.
For your convenience the whole code of ffmpeg.h: