lilypond-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Sets TabVoice Stem height to ##f (issue 6303065)


From: dak
Subject: Re: Sets TabVoice Stem height to ##f (issue 6303065)
Date: Tue, 12 Jun 2012 13:43:09 +0000

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/



reply via email to

[Prev in Thread] Current Thread [Next in Thread]