Here is a code example from beam.cc:

      Interval weights (1 - multiplier, multiplier);

      if (feather_dir != LEFT)
        weights.swap ();

This is _hogwash_.  weights is not an _interval_ here, but a pair of
numbers.  Swapping the bounds of an interval does not even make _sense_.
 Where is the point in type abstraction if one creates total conceptual
chaos without inherent relation to the invariants of the mathematical
model underlying the type?

swap never should have been a public member function (it is used
internally when mirroring intervals).

If a type is named "Interval", it needs to be employed as an Interval,
not as something totally different that relies on implementation
details.

Otherwise type abstraction makes code _less_ maintainable rather than
more, since you always need to take all side-effects into consideration.

http://codereview.appspot.com/6303065/

_______________________________________________
lilypond-devel mailing list
lilypond-devel@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-devel

Reply via email to