Thread: iostream.h (vs) iostream

  1. #1
    former member Brain Cell's Avatar
    Join Date
    Feb 2004
    Posts
    472

    iostream.h (vs) iostream

    sorry if this has been repeated alot but i don't want the answer for me because i already know. Here is what its all about :

    I've been arguing alot with some friends lately. They say that since iostream.h works then they don't care about following the new standard (with iostream).

    I showed them some sites that explain the improvements of the new standard but they kept saying that it works and their proffessor didn't say anything about the new standard so the old one shouldn't be bad.

    Now i kept arguing with them and im real ........ed. They think that using iostream along with the 'using std::' statements is just useless , tiresom and some other stupid reasons.

    What i want from you guys ... is following the old standard bad at some cases? when and why?

    I'd be thankful for posting as much cons as you can about following the old standard...


    thanks for your time..
    My Tutorials :
    - Bad programming practices in : C
    - C\C++ Tips
    (constrcutive criticism is very welcome)


    - Brain Cell

  2. #2
    Registered User jlou's Avatar
    Join Date
    Jul 2003
    Posts
    1,090
    If it works for them, and their teacher accepts it, and they prefer not to get in the habit of doing things according to the standard, then it's fine.

    New compilers don't even accept <iostream.h> (.NET 2003 doesn't even give you a warning or an informative error message). So if they ever want to use their code again in the future, they would have problems.

    It is not wise to mix old a new headers, since it is possible that things could be implemented differently. Because of that it could be dangerous for them to use the newer features of the language that didn't exist in the old headers. That is unlikely to be a problem, but you never know. They probably wouldn't care about this as long as their code works, which is fine.

    Also, the reason the library stuff was put into a namespace was to avoid naming conflicts. I have seen several newbies post problems on programming forums that were caused by naming a function or variable the same thing as a standard library name. With the new headers you can fix that without changing your function, with the old headers you can't.

    And finally, some people prefer to be different, to fight the Man, to not give in to stupid rules. Others prefer to avoid laziness, make good habits that will help them in the future, and be smart. Those aren't the only two options, but if they like the first one better, let them be. There are more important things to worry about, in my opinion.

  3. #3
    Code Goddess Prelude's Avatar
    Join Date
    Sep 2001
    Posts
    9,897
    >using iostream along with the 'using std::' statements is just useless , tiresom
    Definitely tiresome, and in my experience mostly useless, so your friends are correct for the most part on this point.

    >Now i kept arguing with them and im real ........ed.
    The problem is on your end then. Don't try to force your views on others when it's obvious that they don't care. Somebody used to say that you can lead the horse to water, but you can't stop him from voiding his main...or something like that.

    >is following the old standard bad at some cases?
    Technically there is no old standard. There is standard C++ as defined by ISO, and pre-standard C++ as (commonly but selectively) defined by the ARM. Using pre-standard C++ isn't "bad", per se, but it isn't what we would consider programming with an eye toward the future. Already there are popular C++ compilers sold that reject pre-standard C++ (you get an error if you try to use iostream.h), and the older versions of those compilers really suck, so there's a lot of incentive to upgrade. That would be an argument against pre-standard C++, by the way.

    As long as your friends understand that iostream.h and the like aren't guaranteed to work (or worse, aren't guaranteed to work like they expect, though still compile and run), aren't guaranteed to continue to work even if they do, and that they lack useful features of the standard headers, they're making an informed (but stupid) decision and you should respect that.

    I'm afraid you'll have to lump your friends in the category of lost causes. You know people like that, they show up here with GODAWFUL code and try to argue with Salem, myself, quzah, Thantos, or Hammer, whoever decides to take up the banner of the Cprog gestapo until they get frustrated and leave. For people like that there's no help and no hope. Such a shame.
    My best code is written with the delete key.

  4. #4
    Registered User major_small's Avatar
    Join Date
    May 2003
    Posts
    2,787
    Quote Originally Posted by Brain Cell
    I'd be thankful for posting as much cons as you can about following the old standard...
    1) it's old
    2) it doesn't work in most quasi-new compilers...

    those are my reasons for using iostream over iostream.h...
    Join is in our Unofficial Cprog IRC channel
    Server: irc.phoenixradio.org
    Channel: #Tech


    Team Cprog Folding@Home: Team #43476
    Download it Here
    Detailed Stats Here
    More Detailed Stats
    52 Members so far, are YOU a member?
    Current team score: 1223226 (ranked 374 of 45152)

    The CBoard team is doing better than 99.16% of the other teams
    Top 5 Members: Xterria(518175), pianorain(118517), Bennet(64957), JaWiB(55610), alphaoide(44374)

    Last Updated on: Wed, 30 Aug, 2006 @ 2:30 PM EDT

  5. #5
    former member Brain Cell's Avatar
    Join Date
    Feb 2004
    Posts
    472
    I think those ideas did their job. They're now following the new standard..

    Thanks so much jlou , Prelude and major_small

    and sorry for the late response
    My Tutorials :
    - Bad programming practices in : C
    - C\C++ Tips
    (constrcutive criticism is very welcome)


    - Brain Cell

  6. #6
    Registered User major_small's Avatar
    Join Date
    May 2003
    Posts
    2,787
    I didn't really give very good reasons, but your welcome anyhow... the real question: do they actually see the benefits, or are they trying to get you to shut up?
    Join is in our Unofficial Cprog IRC channel
    Server: irc.phoenixradio.org
    Channel: #Tech


    Team Cprog Folding@Home: Team #43476
    Download it Here
    Detailed Stats Here
    More Detailed Stats
    52 Members so far, are YOU a member?
    Current team score: 1223226 (ranked 374 of 45152)

    The CBoard team is doing better than 99.16% of the other teams
    Top 5 Members: Xterria(518175), pianorain(118517), Bennet(64957), JaWiB(55610), alphaoide(44374)

    Last Updated on: Wed, 30 Aug, 2006 @ 2:30 PM EDT

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. iostream vs iostream.h
    By LegendsEnd in forum C++ Programming
    Replies: 16
    Last Post: 03-27-2004, 07:14 PM
  2. iostream or iostream.h?
    By serruya in forum C++ Programming
    Replies: 15
    Last Post: 05-05-2003, 07:41 AM
  3. Problem during compile (iostream.h error)
    By JoJo in forum C Programming
    Replies: 4
    Last Post: 04-29-2003, 06:58 PM
  4. Is there a user input command without using iostream.h?
    By Unregistered in forum A Brief History of Cprogramming.com
    Replies: 4
    Last Post: 11-04-2001, 02:15 AM
  5. << in iostream
    By badman in forum C++ Programming
    Replies: 8
    Last Post: 10-18-2001, 10:19 PM