Re: Advice needed on "Include" files

Subject: Re: Advice needed on "Include" files
From: Kris Olberg <kjolberg -at- IX -dot- NETCOM -dot- COM>
Date: Tue, 13 Oct 1998 21:49:23 -0500

-----Original Message-----
From: Brian, Flaherty <bflaher -at- INDCON -dot- COM>
To: TECHWR-L -at- LISTSERV -dot- OKSTATE -dot- EDU <TECHWR-L -at- LISTSERV -dot- OKSTATE -dot- EDU>
Date: Monday, October 12, 1998 2:41 PM
Subject: Re: Advice needed on "Include" files


>C/C++ programmers referred to them as header files (*.H files).
>TurboBASIC allowed you to include *.INC files during compile-time.
>
>These files tend to contain code which serves some very specific purpose
>(such as setting or resetting specific hardware; or setting packet size,
>or packet error codes, etc.). The code is then *streamed in* during
>compile-time and included in the resultant code.


In C++, although header files are "included" using the #include macro, they
typically serve to contain the class and variable/method (member)
declarations necessary for other classes that instantiate them.

>Most programmers nowadays (especially C++ and Visual BASIC) use them to
>compile DLL files which contain subroutines that are now called by the
>EXE files.


This is true, but it does not accurately describe the purpose of includes.
They originated years (decades) ago to solve the age-old problem of using
common code without having to maintain two or more versions of that code in
separate places. If you instantiate a class called ACCOUNT in a module of a
program (whether a .DLL or .EXE doesn't matter), a C++ compiler must
understand the attributes--member functions and variables and other info--of
the ACCOUNT class, which, by many coding standards, should be contained in
the ACCOUNT.H file. You may instantiate ACCOUNT in many modules; using an
#include to "include" the file in each module allows you to maintain one
version of the ACCOUNT class information without repeating it in each
module.

BTW, the term "include" is not appropriate for a nontechnical audience. It
is only appropriate when the audience is composed of programmers.

Regards...Kris
---------------------------
kolberg -at- healtheon -dot- com
kris -at- olberg -dot- com

From ??? -at- ??? Sun Jan 00 00:00:00 0000=




Previous by Author: Re: Tool knowledge versus Task knowledge
Next by Author: Re: Advice needed on "Include" files
Previous by Thread: Re: Advice needed on "Include" files
Next by Thread: Re: Advice needed on "Include" files


What this post helpful? Share it with friends and colleagues:


Sponsored Ads