Re: Garbage Collection - The Trash Begins To Pile Up
Francis Glassborow wrote:
In article <1167447323.912948.316160@h40g2000cwb.googlegroups.com>, Le
Chaud Lapin <jaibuduvin@gmail.com> writes
3. Never use a polymorphic object when a monomorphic object will do.
However if there are not a fairly high preponderance of polymorphic
hierarchies in your code you are not doing much OOP. That is not in
itself a bad thing but it does say something about your problem domain.
True. Which is why I wrote a year ago in another thread that many of
the topics we have discussed that seem different are actually the same
topic under different guise:
_What Is The Best Way To Design Systems In C++?_
As far as my problem domain goes, I would contend that it is uncommonly
broad.
I think that several people in this thread are tending to assume that
there problem domain and coding style is typical of all uses of C++.
I would guess that there is significant overlap in the problem domain.
It is the coding style that is different. Perhaps people like Mirek
Fidler and myself have discovered a method of engineering that is not
often employed by software engineering. Also, on the matter of OOP, I
feel that people like us have been cheated. No, we do not reach for
the virtual keyword every time we write a member function, but we do
feel that we are exercising good technique in OOP. But the market on
terminology has been monopolized, so we are left with no terms to
describe our way of engineering. Personal, I think our style is
superior to the other kind. Bjarne Stroustrup did write that, when you
have a choice between concrete or abstract, prefer concrete, or
something like that [I cannot find the exact sentence]. What we have
done is trained ourselves to aim for concrete by default. The reason?
If it is true that there is no concrete, you're going to find out that
soon enough anyway.
The result is absolutely wonderful. The current system I have, which
is massive in scope (but not lines of code), could hardly have been
created otherwise. But then again, I'm an
I am much more influenced by the experiences of people like Walter who
changed their views through experience, and the knowledge of people like
Andrei than by those who seem fixated on their current style.
"In matters of style, swim with the current. In matters of principle,
stand like a rock." - Thomas Jefferson
This is a principle issue, not a style issue. Our way of programming
is not appropriate 100% of the time. The "other" way of programming is
not appropriate 100% of the time. What I am saying is that, given a
specific problem, where the ideally, 60% of it would be done with our
way of programming and 40% would be done with the heapaphiliac model,
it seems that programmers will do, say, 10% our way, and 90% using the
other way. It should be obvious that the heapaphiliac method is
"easier". How hard is it to make everything polymorphic and never call
delete? But this is not without penalty. Form counts.
Being an electrical engineer, I have zero doubt that, if some of the
engineers were ask to design a moderately complex circuit, with the
mentality that is employed by hyper-heapaphiliacs, the circuit would be
an utter failure. There would be glitches, burnt parts, noise all over
the place, wasteful power consumption, overkill in choice of
parts...there would be no end to the madness. There is a certain
amount of discipline, restraint, control of your domain, etc. that must
go into the design of systems that have non-zero material cost. Get it
wrong and you will hear a pop, or worse, destroy a $5000 piece of
equipment. And you cannot go to the book store and learn "How To
Design Chebyshev Filters in 21 Days" and call yourself and engineer.
Your devices *must* have some minimal level of integrity, and that
level, I can tell you, is a lot higher than what I see in many software
systems. So it is not just a style issue. It's just that bad
engineering is easy to forgive in software engineering because the
material cost is so low.
We are not speaking from a position of ignorance. We have used virtual
functions. We know what they are. I have classes where they are
absolutely necessary. But I am not convinced that the converse is true,
that the heapaphiliacs know the power of our way of engineering, and
have experienced it first hand.
-Le Chaud Lapin-
--
[ See http://www.gotw.ca/resources/clcm.htm for info about ]
[ comp.lang.c++.moderated. First time posters: Do this! ]