Re: Do header files really serve a useful purpose?
From: tom_usenet (tom_usenet_at_hotmail.com)
Date: 02/26/04
- Previous message: Rolf Magnus: "Re: Operator"
- In reply to: Hattuari: "Do header files really serve a useful purpose?"
- Next in thread: Default User: "Re: Do header files really serve a useful purpose?"
- Reply: Default User: "Re: Do header files really serve a useful purpose?"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
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
- Previous message: Rolf Magnus: "Re: Operator"
- In reply to: Hattuari: "Do header files really serve a useful purpose?"
- Next in thread: Default User: "Re: Do header files really serve a useful purpose?"
- Reply: Default User: "Re: Do header files really serve a useful purpose?"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|