Re: Do header files really serve a useful purpose?

From: tom_usenet (tom_usenet_at_hotmail.com)
Date: 02/26/04

  • Next message: Rolf Magnus: "Re: Create avi from memory"
    Date: Thu, 26 Feb 2004 14:33:10 +0000
    
    

    On Thu, 26 Feb 2004 06:49:03 -0500, Hattuari
    <susudata@setidava.kushan.aa> wrote:

    >I'm learning C++ after having spent several years in the computer industry
    >doing both system administration and engineering. I've written code in
    >Perl, Bash, Pascal, Ada, C, Mathematica (hundreds of lines of OO code, not
    >1+1), JavaScript, Lisp, and Java, as well as C++. Each of these languages
    >has it's strengths and weaknesses. My experience with C++ has shown me
    >that it is by far the most difficult for me to learn.

    Learning it completely is very hard. Learning enough to start writing
    useful programs is quite easy (try Accelerated C++, by Koenig and
    Moo).

    >I have the sense that some of the features in C++ are unnecessary, and
    >server little real purpose. None the less, they do serve to add to the
    >complexity, and hence the difficulty, of learning the language. I know
    >there is a good deal of excellent software written in the language.
    >Perhaps I'm not perceiving things accurately, but I have the sense that C++
    >is losing significant ground to other languages, expecially Java.

    I think Java has lost a lot of ground recently - it had a huge boom a
    few years ago but growth has stopped. C++ demand has surely but
    steadily increased, as I understand it.

    Searching for "Java" and "C++" in your favourite job search engine is
    a good way to get a rough idea.

    >So in that sense, I will ask what good header files really are. They seem
    >to be nothing but administrative overhead to me. I believe they encourage
    >programmers to avoid deviding their work into appropriately selfcontained
    >objects. The also seem to encourage programmers to avoid using namespaces.

    Header files (and the whole preprocessor) are an unfortunate
    carry-over from C. In C they make more sense than in C++, since C
    doesn't have the esoteric name lookup, overloading and template
    instantiation of C++.

    Some kind of code module/database system would be better, although I
    think people would be loathe to give up the preprocessor, however much
    it makes the job of continuous code analyzers (as used in modern Java
    IDEs like Eclipse and IntelliJ IDEA) much harder to do efficiently.

    >For me, they are simply one more point of confusion when trying to remember
    >all the rules of declaring and defining programming constructs. These
    >rules are not, to my knowledge isolated to a compact, accessible reference.
    >I find myself flipping through several chapters trying to find the answer
    >to specific questions regarding parameter assigning defaults to optional
    >parameters, and the like.

    You can always ask in here - answers usually only take minutes to
    appear. Alternatively, learning your way around a particular reference
    book (such as "The C++ Programming Language") can be helpful - it gets
    easier to find what you're looking for.

    Tom

    -- 
    C++ FAQ: http://www.parashift.com/c++-faq-lite/
    C FAQ: http://www.eskimo.com/~scs/C-faq/top.html
    

  • Next message: Rolf Magnus: "Re: Create avi from memory"

    Relevant Pages

    • Re: CollabRx seeks brilliant engineers for an excellent e-science adventure
      ... and i had pretty good OOP internals understanding before learning Lisp. ... common idioms and new features -- and wow, i know one more language. ... what makes lisp programmers better than others? ...
      (comp.lang.lisp)
    • Re: I need serious help!
      ... programmers. ... make than games with moving graphics, so I might start off with a Sky ... quirkiest language I've ever used. ... Ruby's a nice generic language for learning things. ...
      (comp.lang.ruby)
    • Re: CollabRx seeks brilliant engineers for an excellent e-science adventure
      ... and i had pretty good OOP internals understanding before learning Lisp. ... common idioms and new features -- and wow, i know one more language. ... even enterprisey Java programmers discovered ...
      (comp.lang.lisp)
    • Re: use of backward single quote in procedure names, was: DST (summer time) offset
      ... the bloody hard work required to find what needs to be learnt and learning ... is saying that learning to program is itself necessarily easy. ... IT can't all be down to fashion; lots of programmers (andtheir ... employers) must have decided that C was the language to use. ...
      (comp.sys.acorn.programmer)
    • Re: Foundations of F# - Coming Very Soon
      ... code to do analysis using a free language with all the bells and whistles ... This is why we're developing tools aimed at technical ... as a language for smart programmers) but development is much faster and ... If you want F# to pay off then you must put significant effort into learning ...
      (microsoft.public.dotnet.languages.csharp)

    Loading