Slashdot Mirror


Abandoning Header Files?

garethw asks: "I'm working on a project where the lead developer, following a suggestion by our tool vendor, wants to get rid of the header files and directly #include source code. The language is a somewhat specialized language, but for all intents and purposes, you can assume it's Java or C. The conventional argument I recall for using header files, and incremental compilation, is that it's faster to use a makefile and conditionally build only those files that have changed. However, it turns out that the brute force of invoking the compiler once on the top-level does actually compile much faster. I feel that there is something about #include'ing source files directly, compiling only the top-level file, just doesn't 'feel' right and I'm at a loss to really give a solid argument as to why. Has anyone actually used this approach? Does anyone have any thoughts on any advantages or drawbacks?"

3 of 207 comments (clear)

  1. Re:Need more info... by Jeremiah+Cornelius · · Score: 2, Funny

    i.e.: Will they pay for Dennis Ritchie's cardiac medication?

    --
    "Flyin' in just a sweet place,
    Never been known to fail..."
  2. Re:Why? by CamMac · · Score: 5, Funny

    Remeber, if you remove all the comments from the code, it will compile faster and the executable will be smaller.

    --Cam

    --
    All jocks think about is sports. All nerds think about is sex.
  3. Re:The immortal advice of Rocket J Squirrel by Hard_Code · · Score: 2, Funny

    Yeah, seriously, you should be designing modules to interact through clean interfaces with known, published contracts. How you partition your compilation units should fall naturally from this. You shouldn't try to do the reverse and somehow "accrete" a design based on low-level preprocessor hacks.

    --

    It's 10 PM. Do you know if you're un-American?