Re: curiosity about includes
- From: "Ajay Kalra" <ajaykalra@xxxxxxxxx>
- Date: Wed, 26 Mar 2008 23:14:20 -0400
"Joseph M. Newcomer" <newcomer@xxxxxxxxxxxx> wrote in message news:kq3mu3l4qhhu7kcpsf0cgecaj06djg3png@xxxxxxxxxx
The older I get, the lazier I get. Adding gratuitous complexity for the sake of adding
gratuitous complexity serves no purpose.
You may be surprised that how many people I know who do exact opposite, mostly in the name of using cool features. It makes me feel kind of old as one time I used to think like that. It using something(new or exciting etc) for sake of it rather than the need.
---
Ajay
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* makeJoseph M. Newcomer [MVP]
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 [MVP]
"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
email: newcomer@xxxxxxxxxxxx
Web: http://www.flounder.com
MVP Tips: http://www.flounder.com/mvp_tips.htm
email: newcomer@xxxxxxxxxxxx
Web: http://www.flounder.com
MVP Tips: http://www.flounder.com/mvp_tips.htm
.
- Follow-Ups:
- Re: curiosity about includes
- From: Joseph M . Newcomer
- Re: curiosity about includes
- References:
- curiosity about includes
- From: asellon
- Re: curiosity about includes
- From: David Wilkinson
- Re: curiosity about includes
- From: Joseph M . Newcomer
- Re: curiosity about includes
- From: Ajay Kalra
- Re: curiosity about includes
- From: Joseph M . Newcomer
- Re: curiosity about includes
- From: Ajay Kalra
- Re: curiosity about includes
- From: Joseph M . Newcomer
- curiosity about includes
- Prev by Date: Re: curiosity about includes
- Next by Date: Re: Saving an XML file from VC++ application
- Previous by thread: Re: curiosity about includes
- Next by thread: Re: curiosity about includes
- Index(es):
Relevant Pages
|