
-----------------------------------
Mazer
Mon Mar 15, 2004 4:48 pm

namespace std and &lt;iostream.h&gt; vs &lt;iostream&gt;
-----------------------------------
Just wondering how everyone feels about using #include  in their programs instead of #include 
But not just for iostream, for fstream and string and vector as well. I hear alot of talk about how you aren't supposed to include the .h at the end because those are old C headers, and the C++ headers (without .h in the name) are supposedly better. Of course, if I do use the headers without .h, it means I will need to use using namespace std, and as I've noticed, that can blow up my executable to at least 540kb (and all it does is load a 3D katana and spin it).

I'm sure there was something else I wanted to say, but a friend of mine distracted me with some pictures of Carmen Electra and...
Er, so, what do you guys think? Any comments about why it would be "bad practice" to utilize the "old" headers? What's your personal preference?

-----------------------------------
AsianSensation
Mon Mar 15, 2004 6:55 pm


-----------------------------------
I use  and  and etc etc etc without the .h

I dunno, I guess it's Mr.Mckenzie's fault telling us to use those.

-----------------------------------
Tony
Mon Mar 15, 2004 8:23 pm


-----------------------------------
i use  cuz it's shorter :lol: and you don't really have to use namespace... you could use std::cout instead :lol:

-----------------------------------
Mazer
Mon Mar 15, 2004 8:29 pm


-----------------------------------
Yeah, but would you do that for every time you want to use cout? Adding std:: in front does cut down the size of the executable (who would've thought that an std could be a good thing... naoki :wink: ) that you'd get by using the standard namespace, but if I have alot of stuff that is in the standard namespace, that gets kinda annoying. Right now I'm only using std:: for declaring vector class objects. Which is good because I only need to use it once each time.

-----------------------------------
wtd
Mon Mar 15, 2004 10:05 pm


-----------------------------------
I always use , , , , ,  and such.  It's the way of the future.  The headers that end in .h might be there for legacy support, but make no mistake, that's the only reason they're there.

As for:

using namespace std;

I don't mind using it quite as much in my main function, though I prefer not to.  However, I generally prefer to never use it in a library, and I only ever use it inside a function, and never in the global namespace.

-----------------------------------
rizzix
Mon Mar 15, 2004 11:28 pm


-----------------------------------
meh... no opinion

-----------------------------------
Tony
Tue Mar 16, 2004 12:44 am


-----------------------------------
I think that you're a tool, mazer. Suicide is something that I'd consider if I were you. The slow and painful kind. C++ is for losers, turing all the way.


By the way, this is martin...err 'Darkness'

Love it or shove it.

-----------------------------------
wtd
Tue Mar 16, 2004 12:57 am


-----------------------------------
C++ is painful, but it's incredibly powerful.

"The more programming languages you know, the more you realize they all suck."

-----------------------------------
Mazer
Tue Mar 16, 2004 8:23 am


-----------------------------------
I think that you're a tool, mazer. Suicide is something that I'd consider if I were you. The slow and painful kind. C++ is for losers, turing all the way.


By the way, this is martin...err 'Darkness'

Love it or shove it.
LM ass O.  :wink: 
As soon as you suggested suicide I kinda figured it would be Darkness, of course when you called me a tool I thought you might me James. And by that I mean, suicide would be a very good idea for you. Besides, tony wouldn't insult me, we're on the same team fighting Dan Shadow to get back the book of typos.

-----------------------------------
Tony
Wed Mar 17, 2004 12:34 am


-----------------------------------
Your mom's on the same team fighting Shadow Dan. On a trampoline.

-----------------------------------
Mazer
Wed Mar 17, 2004 8:14 am


-----------------------------------
I hereby decree that the next post shall be directed at Martin.

-----------------------------------
Tony
Wed Mar 17, 2004 11:33 am


-----------------------------------
Your mom puts the tramp into trampoline

-----------------------------------
Thuged_Out_G
Tue Mar 23, 2004 5:49 pm


-----------------------------------
Your mom puts the tramp into trampoline

odd, but i thought i had heard a rumor about you being conceived on a trampoline  :wink:  :lol: 

jk lol

-----------------------------------
jonos
Tue Mar 23, 2004 9:00 pm


-----------------------------------
wqow this is interesting. i use the .h just because the first tut i found had that... but my sams book (which is not the best) says that you don't have to have the .h because the compiler knows what you mean, which i think may be wrong, but sams has a lot of books.

-----------------------------------
jonos
Tue Mar 23, 2004 10:26 pm


-----------------------------------
to all you advanced c++ers, would you recommend using:

using namespace std;

or by using:

std:: cout 