Re: curiosity about includes

Tech-Archive recommends: Fix windows errors by optimizing your registry



The older I get, the lazier I get. Adding gratuitous complexity for the sake of adding
gratuitous complexity serves no purpose.

As for a seriously annoying problem caused by grotesque misuse of #include, see my latest
post at

http://www.flounder.com/msdn_documentation_errors_and_omissions.htm#_USE_MATH_DEFINES
joe

On Wed, 26 Mar 2008 22:35:56 -0400, "Ajay Kalra" <ajaykalra@xxxxxxxxx> wrote:

As the time passes, I realize more and more that things which *can* make
your life complex should be avoided altogether. Although I understand all
this, I just find that they *can* add needless pain from maintenance point
of view.

---
Ajay

"Joseph M. Newcomer" <newcomer@xxxxxxxxxxxx> wrote in message
news:11rlu3l9tnar8u5rct9emhjbregp4grcaj@xxxxxxxxxx
Used properly, header files can be largely ignored as a complexity. Used
poorly, they are
a disaster, and that's one of the reasons that modern languages tend to
not use them.

Precompiled headers are a useful trick, but they can be largely ignored
most of the time
because they simply work.

Much of what macros did have been replaced by concepts such as generic
methods
(templates), which are linguistically sounder (and usually have
well-defined semantics)
joe

On Wed, 26 Mar 2008 17:38:34 -0400, "Ajay Kalra" <ajaykalra@xxxxxxxxx>
wrote:


"Joseph M. Newcomer" <newcomer@xxxxxxxxxxxx> wrote in message
news:it0lu3tmn5p5l22djlfhbdr5gm32sg8jdj@xxxxxxxxxx
For many years I worked on the principle that every #include file should
include
everything it needs to compile correctly. After one disaster about 12
years ago when I
inherited a mess of code where A required B required C required D
required E, and also Q
required B, but none of the headers had include guards,... anyway it was
a
total mess, and
I spent about three days making it sane, only to have the client tell me
that "the
compilations are inefficient because you are including files more than
once" (never mind
that on my poor old 500MHz machine it would compile in under a
minute...AFTER then
changes!) and demanded I "fix" the code back to its original state.
After
a couple weeks
of arguing, I basically dropped the client, saying I would not work on a
project whose
integrity was compromised by antiquated notions of "efficiency" (their
lead programmer had
apparently learned on PDP-11s, and was even unhappy that "the
preprocessor
is always run
even when it isn't needed", and did not understand precompiled headers)

But I've always been disappointed that Microsoft requires the #include
order, when it
makes a lot more sense for every view header to include the document
header file.

I have always hated the concept of include files and the tricks that one
can
play to make it "Efficient". For me it was a welcome change that I didnt
have to deal with this mess (no macros etc) when I moved to .net.

---
Ajay

Joseph M. Newcomer [MVP]
email: newcomer@xxxxxxxxxxxx
Web: http://www.flounder.com
MVP Tips: http://www.flounder.com/mvp_tips.htm
Joseph M. Newcomer [MVP]
email: newcomer@xxxxxxxxxxxx
Web: http://www.flounder.com
MVP Tips: http://www.flounder.com/mvp_tips.htm
.



Relevant Pages

  • Re: curiosity about includes
    ... everything it needs to compile correctly. ... inherited a mess of code where A required B required C required D required E, ... required B, but none of the headers had include guards,... ... integrity was compromised by antiquated notions of "efficiency" (their lead programmer had ...
    (microsoft.public.vc.mfc)
  • Re: curiosity about includes
    ... Precompiled headers are a useful trick, but they can be largely ignored most of the time ... everything it needs to compile correctly. ... inherited a mess of code where A required B required C required D ... integrity was compromised by antiquated notions of "efficiency" (their ...
    (microsoft.public.vc.mfc)
  • Re: Redirect COUT to file
    ... The old headers are non-standard, ... compile and link this file. ... execute the exe-file the program crashes and I get this error message: ... //BUT NOT WITH CYGWIN G++ ...
    (comp.lang.cpp)
  • Re: Automatically generate variables
    ... use any non-standard stuff in its own headers. ... I did *not* say the program was strictly conforming. ... See, it does compile. ... We are not discussing quality of microsoft implementation, ...
    (comp.lang.c)
  • Re: hid.dll & VC++ 6
    ... VC6 is too old. ... Many of the headers in the current WDK will not compile ... missing ')' before identifier 'HIDP_REPORT_TYPE' ...
    (microsoft.public.win32.programmer.kernel)