discuss: The Linux Quality Database
Subject:
Re: The Linux Quality Database
From:
"Michael D. Crawford" ####@####.####
Date:
10 Sep 2002 02:04:40 -0000
Message-Id: <3D7DC423.5090205@goingware.com>
John Levon posted some criticisms of my C++ member function pointer article.
I actually had been completely unaware of boost::function. Thank you for
pointing it out, I will look into it.
I do use functionals in my C++ code, for example as a parameter to the STL
find_if, but those are really different things.
I don't want to get into a hair-splitting argument over programming style here,
that would be off-topic. But I do want to address John's criticisms. I'm well
aware the C++ article needs more work.
I don't agree that micro-optimization is harmful to code quality, at least not
if it is done well. I think one of the problems that a lot of software has
these days is that people have forgotten how to write efficient code, and
micro-optimization has its place in that, for example in tight graphics blitting
loops.
I discuss this at some length in the sections "The Value of Constant Factor
Optimization" and "Old School Programming" in:
http://www.kuro5hin.org/story/2002/5/9/205040/3918
You should know I've been programming professionally for fifteen years, and have
been self-employed as a consultant for over four years. I've been in the
business long enough to have written code on extremely constrained computers.
The problem these days is that many programmers assume they have infinite
resources, with the result that many applications work slower on today's 1 GHz
machines than equivalent applications used to work on 20 Mhz machines.
I have not actually used member function pointers in my own code very much, but
in each case the code was performance critical. One was alpha blending during
interactive animation, and the work the inspired me to write the article was a
database search. In each case member function pointers solved a significant
problem, and in each case the time for dereferencing the pointer _was_ important
enough to be a consideration.
Pointers to C++ Member Functions is at:
http://linuxquality.sunsite.dk/articles/memberpointers/
Mike
--
Michael D. Crawford
GoingWare Inc. - Expert Software Development and Consulting
http://www.goingware.com/
####@####.####
Tilting at Windmills for a Better Tomorrow.