Hi Knute,

> I have a "best practices" question.  I've noticed while looking at snippets 
> in the LIlyPond docs and the code of experienced writers, that they will 
> write things like
> 
>     \override Parentheses.font-size = #-4
> 
> with a pound sign before the number, while writing
> 
>     \override Parentheses.font-size = -4
> 
> produces no error or warning.  But is it the best practice?

Personally, I use # [in such situations] for several reasons:

1. It makes the location of the value(s) more visually obvious to me, even in 
editors (like Frescobaldi) with syntax colouring/highlighting.

2. It used to be required in certain places — and may still be, in a few places 
I’m not currently able to name? — and thus using it everywhere [even if it’s 
not strictly necessary] makes the code more consistent, and in any case is my 
well-engrained habit.

>   Other examples:
>     \clef "bass"

Same thing: one must use clef “treble_8” (\clef treble_8 throws an error), so I 
make it consistent.

>     \tag #'layout

Since both

    \tag a,b
    \tag (a,b)

fail but

    \tag #’(a,b)

doesn’t, I once again just make it consistent.

> I don't want to write extra characters, but I also want to write clear code.  
> What are your thoughts?

I certainly understand your concern(s). Personally, I feel the clarity and/or 
consistency of the resulting code [slightly] outweighs the effort of typing 
these particular extra characters, so I do it. YMMV. :)

Hope that helps!
Kieren
__________________________________________________

My work day may look different than your work day. Please do not feel obligated 
to read or respond to this email outside of your normal working hours.


Reply via email to