.nothing

Discussion in 'C++' started by bob, Apr 19, 2012.

  1. bob

    bob Guest

    Why did the .h get dropped from many files? For instance, why did vector.h become vector and iostream.h become iostream?
     
    bob, Apr 19, 2012
    #1
    1. Advertising

  2. On 19.04.2012 15:57, bob wrote:
    > Why did the .h get dropped from many files? For instance, why did vector.h become vector and iostream.h become iostream?


    No idea. Most likely because the changes including the namespaces were
    no longer source compatible.
    But I have no idea why the extension got completely dropped instead of
    using e.g. .hpp or whatever. Win Explorer and some other applications
    dislike files without extensions. AFAIK only Mac and OS/2 use name
    independent file types in meta data. And *nix can reasonably live
    without the extension.


    Marcel
     
    Marcel Müller, Apr 19, 2012
    #2
    1. Advertising

  3. On 4/19/2012 9:57 AM, bob wrote:
    > Why did the .h get dropped from many files? For instance, why did
    > vector.h become vector and iostream.h become iostream?


    I guess in the mid-nineties there were development systems coming out
    where definitions and declarations aren't necessarily kept in files, so
    the Committee decided to abandon the "header *file*" concept and instead
    introduce the "header" concept that might or might not correspond to a
    named external storage area ("file"). Extensions are irrelevant when
    name has nothing to do with the file system on which the compiled code
    resides.

    V
    --
    I do not respond to top-posted replies, please don't ask
     
    Victor Bazarov, Apr 19, 2012
    #3
  4. On 19 апр, 17:57, bob <> wrote:
    > Why did the .h get dropped from many files?  For instance, why did vector.h become vector and iostream.h become iostream?


    Because before accepting the C++ Standard different C++ compilers use
    different extensions for C++ headers as, for example, hxx, hpp (or
    others) that to distinguish C++ headers from C headers. For example
    two headers, <string.h> and <string.hpp>, could be present in a C++
    implementation.

    So the Committee decided to remove extensions for C++ headers and to
    prefix with letter 'c' for C standard headers . Though any
    implementation internally may use the same extensions for headers as
    it used them before.
     
    Vlad from Moscow, Apr 19, 2012
    #4
  5. On 4/19/2012 8:57 AM, bob wrote:
    > Why did the .h get dropped from many files? For instance, why did vector.h become vector and iostream.h become iostream?


    To give interviewers a way to distinguish between C programmers and C++
    programmers when they made the mistake of asking for C/C++ programmers,
    but were really looking for C++ programmers or were really looking for C
    programmers.
     
    Christopher Pisz, Apr 19, 2012
    #5
  6. bob

    Jorgen Grahn Guest

    On Thu, 2012-04-19, Marcel Müller wrote:
    > On 19.04.2012 15:57, bob wrote:
    >> Why did the .h get dropped from many files? For instance, why did
    >> vector.h become vector
    >> and iostream.h become iostream?

    >
    > No idea. Most likely because the changes including the namespaces were
    > no longer source compatible.


    I always thought about it as a migration path to C++98. When you
    migrated, you removed the .h and did the updates needed to cope
    with the std:: namespace.

    > But I have no idea why the extension got completely dropped instead of
    > using e.g. .hpp or whatever. Win Explorer and some other applications
    > dislike files without extensions. AFAIK only Mac and OS/2 use name
    > independent file types in meta data. And *nix can reasonably live
    > without the extension.


    Not just "reasonably" -- there are a few things in Unix which depend
    on file naming conventions (C++ source files and object files come to
    mind) but those are exceptions to the general rule.

    /Jorgen

    --
    // Jorgen Grahn <grahn@ Oo o. . .
    \X/ snipabacken.se> O o .
     
    Jorgen Grahn, Apr 20, 2012
    #6
  7. bob

    Paul N Guest

    On Apr 19, 2:57 pm, bob <> wrote:
    > Why did the .h get dropped from many files?  For instance, why did vector.h become vector and iostream.h become iostream?


    I'm wondering whether the vast difference between <string> and
    <string.h> has any bearing on this question?
     
    Paul N, Apr 20, 2012
    #7
  8. On 4/19/12 9:57 AM, bob wrote:
    > Why did the .h get dropped from many files? For instance, why did vector.h become vector and iostream.h become iostream?


    I will note, besides the other comments that have been made, that the
    standard does not require that <vector> does not need to reside in a
    file with the name "vector" (or even in a file). It is quite legal and
    proper for a compiler to define that when including a file with a name
    without an extension, the compiler will also look for that same file
    with the, say, .hpp extension, thereby allowing the file to have an
    extension for those tools that want/need one, but also to look in source
    files the way the standard describes.
     
    Richard Damon, Apr 21, 2012
    #8
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Mark Kamoski

    setting to Nothing

    Mark Kamoski, Aug 7, 2003, in forum: ASP .Net
    Replies:
    1
    Views:
    1,101
    Robert Jacobson
    Aug 7, 2003
  2. Claudio Biagioli
    Replies:
    2
    Views:
    4,608
    William F. Robertson, Jr.
    Jun 25, 2003
  3. Hector Bejarano

    Request.UrlReferrer is nothing

    Hector Bejarano, Jul 8, 2003, in forum: ASP .Net
    Replies:
    0
    Views:
    892
    Hector Bejarano
    Jul 8, 2003
  4. Sven Nilsen

    Re: Is Nothing?

    Sven Nilsen, Jul 16, 2003, in forum: ASP .Net
    Replies:
    0
    Views:
    448
    Sven Nilsen
    Jul 16, 2003
  5. Devin Jeanpierre
    Replies:
    2
    Views:
    535
    Devin Jeanpierre
    Feb 14, 2012
Loading...

Share This Page