lilypond-devel
[Top][All Lists]
Advanced

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

Re: Calculate wordwrapped/justified lines using the stencil stacking pri


From: Janek Warchoł
Subject: Re: Calculate wordwrapped/justified lines using the stencil stacking primitives (issue 13827044)
Date: Wed, 25 Sep 2013 00:00:45 +0200

Hi David,

2013/9/24  <address@hidden>:
> Do you have an actual problem with how the new code is
> written in comparison to the old code?

No, not at all!  I apologize for not making my intentions clearer.  I
asked for an example not because i doubted your patch - i just wanted
to have some output to look at, so that i would understand the patch
better.  I actually haven't read the code yet - as you know, i'm not
fluent with Scheme, and i expected that i wouldn't manage to
understand the patch without having some example.  I'm sorry that my
question made you anxious.

> I sometimes have a hard time
> understanding why people object against refactoring code even when the
> old code has been prodded until it happens to turn out the correct thing
> most of the time without anybody exactly knowing why.

This situation occasionally happens to me as well, and i don't
understand it either.

> But assuming that this code would not actually fix anything but lead to
> equivalent results: would you object to it?

No, absolutely not!  I know that you're a much better programmer that
i am, so unless i'd find something explicitely suspicious (which is
unlikely) i would never object to code refactoring.

> "It works" is not the ultimate excuse for everything.  Because if no-one
> can understand _why_ it works, then even in the case that it works in
> 100% of all cases now, future changes might break it unintentionally
> when nobody can understand the reason it works.

Absolutely!

> Issue 3552 is such a case where I changed code not because of any known
> breakage, but because the risk of future breakage in connection with
> superficially unrelated and/or user code.

That's a good reason to change things.

> On 2013/09/24 07:46:17, janek wrote:
>> could you give an example of how it was failing before?
>
> Regtests change, and the new regtests seem pretty consistent.  I was not
> going to measure this out in detail.  The comments of the old code also
> spell out a failure case.  Check out
> \markuplist
> #(map (lambda (n)
>        #{ \markup
>             \override #'(line-width . 60)
>             \column {
>               \override #`(text-direction . ,(if (zero? (remainder n 2))
> RIGHT LEFT))
>               \justify { $@(map number->string (iota (quotient n 2))) }
>               \draw-hline
>             }
>        #})
>   (iota 160 60))
>
> and you'll see that the old code has problems in the patterns ending on
> 85 and 104.

Thanks, this should help me understand what's going on.
Interestingly, with current master (bfdebcb93bebe820c2d5fd6c1bed) the
pattern ending with 104 appears to be fine.

best,
Janek



reply via email to

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