geni wrote:
2009/1/13 Tim Starling tstarling@wikimedia.org:
I believe that the solution to this problem lies in borrowing concepts from software engineering, such as variables, functions, minimally parenthesized programming languages, libraries, objects, etc. I know that many template programmers cannot program in a traditional programming language, but I have a feeling they could if they wanted to.
How well do those concepts stand up when you have a lot of people copying and pasting code they don't really understand (writing an infobox from scratch is hard modifying an existing one less so)?
Copying is an exceedingly common practice in software engineering. If I replaced "infobox" with "feature" in your comment then you'd sound like a software engineer. The answer is that it will work just fine, the copier only has to have the vaguest familiarity with the language to be able to do it.
However, it's generally discouraged, because the widely copied code becomes difficult to edit. If a bug is found in it, for instance, it will be necessary to find all instances of the code and to change them. The process of merging common code to a library of functions is called refactoring (during maintenance) or abstraction (during design), and is a common task for more experienced programmers. The aim of refactoring is to keep the boilerplate text that is copied as small and elegant as possible, to minimise the number of things that can go wrong with it.
The template equivalent to refactoring is the introduction of meta-templates, such as {{infobox}}.
-- Tim Starling