For Programmers: Free Programming Magazines  


Home > Archive > Fortran > August 2007 > Use of Include Files (Was: Why Fortran?)









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Use of Include Files (Was: Why Fortran?)
Craig Dedo

2007-08-28, 7:12 pm

"fred" <fredantispam@free.fr> wrote in message
news:87sl6xvx4u.fsf@free.fr...
> Quadibloc <jsavard@ecn.ab.ca> a écrit :
>
>
> Sorry, I can't call it a divantage to include math.h
>
> --
> http://scipy.org/FredericPetit


I do consider it to be a divantage. Let's see . . . if I want
procedure a(), I have to remember to #include x.h but if I want procedure
b(), I have to #include y.h. Since ISO standard C99 has around 20 different
header files and dozens of functions, that's a lot of combinations to
remember. I'd rather not have that headache.

This is not an academic issue. I have done professional consulting work
in several different shops that had a shop standard that defined a
consolidated header file that did nothing but #include all of the header
files defined in the C standard. Then you were supposed to #include this
consolidated header file at the top of all source code files. They did this
precisely so you could avoid this memory problem of what you need to
#include in order to get the procedure you wanted.

Fortran avoids this issue in almost all cases. Almost everything is
included automatically. There are only a handful of exceptions where you
have to USE one or more intrinsic modules in order to get needed
funationality:
* IEEE floating point exception handling
* Interoperability with C
* I/O definitions
Unfortunately, the current trend on J3 appears to be to define additional
intrinsic modules for new functionality, even where that is not needed for
reasons of run-time efficiency or to make named constants available. Thus,
the tradition of "everything is automatically included" may be slowly
breaking down.

--
Craig Dedo
17130 W. Burleigh Place
P. O. Box 423
Brookfield, WI 53008-0423
Voice: (262) 783-5869
Fax: (262) 783-5928
Mobile: (414) 412-5869
E-mail: <cdedo@wi.rr.com> or <craig@ctdedo.com>


Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com