Does it hurt to have to many Directory?

I realize at first this sounds confusing, and if you get it, it sounds stupid. But I was wondering if you could use it like a simple pre-layout.

Here is what I am trying to say...
1
2
3
#include <iostream>
#include <fstream>
#include <string.h> 


even if all I have is:
cout << "jeifjeifg\n";

Does it hurt to have the extra directories?
Generally speaking, it's not a great idea. Any code you #include is going to have to be compiled, whether or not you used it. So you'd be taking more time and space to build things that you wouldn't be using.
That should only increase the program size but on runtime it shouldn't be much bad, if you think that your program will have a future development using those headers, there is nothing wrong in including them. Of course if you include them just because you like typing, is not that useful...
Note that it only hurts compile time. Run time is unaffected by inclusions. Not even code size is affected by inclusions. In most cases. MinGW is an exception: including a certain part of the standard library increases code size tenfold.
Ok, it doesn't bother me due to the fact I will build on from there, I just simply showed if it as a template file... But thanks guys
Last edited on
Whoops. I did mean compile time. One of these days I'll learn to specify my times...
Topic archived. No new replies allowed.