Thread:Catinthedark/@comment-3225604-20170722082846/@comment-26235098-20170731232932

Mulli,

'''Don't mix presentation and data layer. Modern Programming 101.'''

I think I said it already up the thread but I will be very explicit now. What you are suggesting with the 'table snippets' enmeshes the information layer and the presentation layer, which is considered very poor programing practice - thus undesirable. I appreciate you eagerness to make things tidy: this is a good goal. Howevert there are other ways to achieve this which maintain code flexibility.

Templates are used to shape what the user sees - this is presentation. We do include some logic in there, and currently, there is a lot of data in there as well. Out automation efforts involve moving the data out - but the benefit of doing this is decoupling the data from the presentation. Then users can change the presentation or make different presentationsof the same data, without having to manually repeat data values or update them in multiple places if they change.

If we move "table snippets' into Lua, we are not decoupling the two- we are just moving the "mess" into the modules. Now being an imperative language Lua will be less messy, but the decoupling is the most beneficial part of this - and that would be lost. Transformation languages are built expressly for presentation, and should not be hardcoded and spit out by a data manipulation module.  The presentation layer must always be open and flexible for most editors to be able to change, enhance, add to. The data should be accessible independently, so that one can change presentation, or build multiple different presentations of the same, with a gurarantee of content consistency.

You could argue that returning a colour codes also mixes presentation - but this it is at least an atomic value, easy to apply in many contexts, and also, it is something we wish to define and maintain consistent everywhere as an indicator, so if you like it is 'metadata' - same as a category.