chiark / gitweb /
doc/intro.tex: Strengthen the argument about C++ a bit.
authorMark Wooding <mdw@distorted.org.uk>
Sat, 9 Jun 2018 02:49:35 +0000 (03:49 +0100)
committerMark Wooding <mdw@distorted.org.uk>
Sat, 9 Jun 2018 02:52:28 +0000 (03:52 +0100)
doc/intro.tex

index f77eed05cb463c3da3b4e1f8e50c02aea13be988..3e5e8f72b9a21aa5cb546851dfc05e86b86477dc 100644 (file)
@@ -143,10 +143,13 @@ which is unlikely to be what was wanted: `B' prints twice, and the `before'
 and `after' actions are both in the middle.\footnote{%
   Of course, one could have arranged to call @|Y::f| before @|X::f| -- but
   the important point is that one would have needed to \emph{know} that this
 and `after' actions are both in the middle.\footnote{%
   Of course, one could have arranged to call @|Y::f| before @|X::f| -- but
   the important point is that one would have needed to \emph{know} that this
-  was necessary.} %
+  was necessary.  And you still end up with two copies of `B'.} %
 The problem is that correctly composing behaviour from a collection of
 superclasses requires knowledge of all of the superclasses involved and how
 The problem is that correctly composing behaviour from a collection of
 superclasses requires knowledge of all of the superclasses involved and how
-they're supposed to work together.
+they're supposed to work together.  Messing with virtual base classes has
+eliminated the problem of duplicating @|B|'s state, but has done nothing to
+help avoid duplicating @|B|'s \emph{behaviour} -- which is a shame, because
+duplicating one without the other is going to end badly.
 
 The obvious workaround is to separate the functionality -- here, printing the
 messages -- from the plumbing, which arranges to do everything in the right
 
 The obvious workaround is to separate the functionality -- here, printing the
 messages -- from the plumbing, which arranges to do everything in the right