Revision as of 12:22, 23 January 2006 editLocke Cole (talk | contribs)Extended confirmed users, File movers, Pending changes reviewers, Rollbackers18,892 edits →Simplest possible codeset: oh, and support← Previous edit | Revision as of 12:25, 23 January 2006 edit undoNetoholic (talk | contribs)Autopatrolled, Extended confirmed users39,916 edits →Policy/Guideline statusNext edit → | ||
Line 1,262: | Line 1,262: | ||
:I think we should stop fiddle around with this page until we know more from Brion. Ugliness and fragility is not that helpful as a guideline. The policy tag is gone and I'm also happy with the removal of the guideline tag. I think that's it for the moment. If we edit here too much we just end in another useless content dispute. The comments about meta-templates from Brion and his expression to implementent conditionals in MediaWiki speek for itself. These are the most important two things. --] 10:18, 22 January 2006 (UTC) | :I think we should stop fiddle around with this page until we know more from Brion. Ugliness and fragility is not that helpful as a guideline. The policy tag is gone and I'm also happy with the removal of the guideline tag. I think that's it for the moment. If we edit here too much we just end in another useless content dispute. The comments about meta-templates from Brion and his expression to implementent conditionals in MediaWiki speek for itself. These are the most important two things. --] 10:18, 22 January 2006 (UTC) | ||
:: I'm not comfortable with that. Brion is a paid developer. He's paid to make Wikimedia work well. ''Of course'' he is going to defend how well Wikimedia is working because anything else reflects on him. Jamesday is a database developer and knows full well how "costly" database reads are over other operations. Both agree that we should reduce template calls where necessary. The developers are not disagreeing - Jamesday describes the theory behind it all, and he's right. Brion wants to be shown proof that Misplaced Pages is ''actually'' being affected, and he's right. Both are in total agreement that complex code should be avoided for the editor's sake. This page is just one more guideline for good use of templates. -- ] ] 12:25, 23 January 2006 (UTC) |
Revision as of 12:25, 23 January 2006
Shortcut- ]
- Archives
- Misplaced Pages talk:Avoid using meta-templates/Archive - Feb 2005—Nov 2005
Logic templates
I intend to author a new section for this page dealing with the specific problems related to the so-called "logical" templates being created and used (see Category:If Templates and Category:Boolean Templates). A few "clever" individuals have found a way to hack the template mechanism into doing things it was not intended for. Rather than petition the MediaWiki developers (or write code themselves), they've put this kludge into effect and it is unfortunately growing rapidly. The problems I see with this are:
- As described on WP:AUM, templates within templates have a direct effect on the performance of the wiki, just like templates used for meta-formatting.
- The developers may make future changes to the template mechanism which would make these logical templates fail. The amount of rework if we need to fix the related templates and pages could be incredibly extensive.
- New and old users alike have a hard time understanding how these all work. This discourages participation in the entire authoring process.
- Templates in general should be used sparingly. Certain tasks, like inserting book references, are not being better served by using a template.
I'm going to ask some key people for comments on this topic. -- Netoholic @ 14:47, 9 December 2005 (UTC)
- Please also have a look at the discussion that emerged on User talk:AzaToth#Misplaced Pages:Avoid_using_meta-templates. – Adrian | Talk 15:22, 9 December 2005 (UTC)
- Maybe that discussion should be moved here? — Omegatron 15:25, 9 December 2005 (UTC)
- Agreed. I already put a pointer to here on User talk:AzaToth#Misplaced Pages:Avoid_using_meta-templates. – Adrian | Talk 15:29, 9 December 2005 (UTC)
- Maybe that discussion should be moved here? — Omegatron 15:25, 9 December 2005 (UTC)
- Re: "Rather than petition the MediaWiki developers (or write code themselves)" we can still do that. "and it is unfortunately growing rapidly" :-) If this is true, this means that it gained some popularity as it seems to be grounded on some editors real needs. If this is enough evident, there will be enough drive to do "petition the MediaWiki developers (or write code themselves)". Which might be a good thing (if that should prove needed). – Adrian | Talk 15:38, 9 December 2005 (UTC)
- See also m:Template:If and Category:Citation templates. – Adrian | Talk 16:02, 9 December 2005 (UTC)
There is one template that is almost impossible to use without logical templates, that is {{language}} →AzaToth 17:31, 9 December 2005 (UTC)
- When I look at the code in that template, I want to throw up. I'll post on that talk page further. -- Netoholic @ 17:55, 9 December 2005 (UTC)
- I wouldn't say it's "almost impossible to use". I would rather say it's almost impossible to implement. Usage is not affected by how it is implemented (as long as it can be implemented, of course). – Adrian | Talk 18:58, 9 December 2005 (UTC)
On the contrary: I find that inserting book references is better served by using a template. Uncle G 18:26, 9 December 2005 (UTC)
- I agree, I personally dont know how to type a reference by my self, a template gives me defined fields to use (like author goes here) →AzaToth 18:30, 9 December 2005 (UTC)
- I agree. Book templates help keep our articles referenced in a standard way. Keeping our material referenced properly is very important if we hope to create a useful encyclopedia. — Omegatron 19:29, 9 December 2005 (UTC)
Re: "New and old users alike have a hard time understanding how these all work. This discourages participation in the entire authoring process". Not every user of book reference needs to understand how it was implemented. Those who do not take part in the development of book reference and the like never need to have a look at if & co. at all. The logic templates are mostly needed in more complicated templates like book reference, but there, they are essential. There is generally no need to use the logic templates on article pages. – Adrian | Talk 18:50, 9 December 2005 (UTC)
Re "Templates in general should be used sparingly". No. To the contrary. If we have an abstraction mechanism, then we should use it. This increases dependency but this is a good thing. Complicated things should be built up by using less complicated and tested building blocks. This is a well known engineering principle. – Adrian | Talk 19:07, 9 December 2005 (UTC)
Re "A few "clever" individuals have found a way to hack the template mechanism into doing things it was not intended for". This is something very normal. If you have some powerful successfull tools, they sooner or later get used in ways you never dreamt of. I understand that this can be seen as threat. But it isn't. Just start thinking how to anticipate that new usage, if it's really needed and helps to solve real problems. – Adrian | Talk 19:12, 9 December 2005 (UTC)
Comment, I checked the use of class="hiddenTemplate", it works optimal only if the specified parameter value does not include "
→AzaToth 19:36, 9 December 2005 (UTC)
See User talk:Adrian Buehlmann#Spamming. No further comment needed from my side. – Adrian | Talk 19:44, 9 December 2005 (UTC)
- This sounds like functionality to do this kind of thing should be implemented within the template syntax, where it would be cleaner, less taxing on the server, not use meta-templates, etc etc. Some of the functionality being implemented in this way is proving to be very useful for the average template user - such as making Template:Book reference not need a dozen different variations to handle different sets of provided information.
- I know, {{sofixit}}, so I plan to spend some time pretty soon on learning PHP so I can start working on stuff like this ... —Matthew Brown (T:C) 23:52, 9 December 2005 (UTC)
What on earth?
This page (in the version I restored and will happily lock) is a guideline not because of a consensus vote on a talk page, but because of sound technical reasons to avoid using the damn things. Just because you really want to do 'l33t Mediawiki hacks doesn't mean you can build consensus to make it not technically the case, any more than 2+2 equalling 4 is up for a vote. The only reason templates in templates aren't switched off entirely is because they're needed for a few specific purposes. That's why you're supposed to AVOID USING METATEMPLATES, not because some m33nz0r wants to keep you from the k3wl stuff - David Gerard 23:07, 9 December 2005 (UTC)
- I did remove it becaus the box specified it's a guideline, and guideline says is by consensus, but after reading this talk page there was none, I didn't meen to WP:POINT →AzaToth 23:17, 9 December 2005 (UTC)
- m33nz0r? whatdoes that meen? →AzaToth 23:34, 9 December 2005 (UTC)
- I do not understand what you want to say. Can you tell us what to do with {{book reference}} and {{web reference}}? You are also invited to write on the respective talk pages of those templates. That would fit much better than writing to people on their user talk pages. Please note that AUM is guideline, not a policy. As the box states "This page is considered a guideline on Misplaced Pages. It illustrates standards of conduct, which many editors agree with in principle. However, it is not a policy". "which many editors agree with in principle" seem to be just Netoholic so far in this specific matter. As this is not a policy, there may be others who don't follow this guideline, for good reasons. – Adrian | Talk 00:25, 10 December 2005 (UTC)
- You may also write on the discussion page of Category:Citation_templates, as this covers a whole bunch of if or qif using templates. Thanks. – Adrian | Talk 00:34, 10 December 2005 (UTC)
Any of this still valid?
Wikimedia's server capacity has gone up a few orders of magnitude this year. I'm not convinced that templates represent anything like the proportion of the total load they used to, and are therefore no longer a problem ("with enough power, a brick can fly"). Dan100 (Talk) 12:13, 10 December 2005 (UTC)
- Please take a look at the source for Template:Language. I don't care how fast the servers are, that template has been coded into complete obscurity. -- Netoholic @ 15:14, 10 December 2005 (UTC)
- That's your POV, I belive User:Garzo knows what he do, he is a linguist specialist →AzaToth 15:21, 10 December 2005 (UTC)
- Is it really a good thing that only one editor knows what's going on with that template? -- Netoholic @ 15:32, 10 December 2005 (UTC)
- There are plenty more peoples that knows what's going on in the template. But are you blaming User:Garzo for not creating a template in your way? →AzaToth 15:37, 10 December 2005 (UTC)
- I can confim that there are several others which are able to understand this form of template. It's not that complicated as it might look at first sight. It takes a moment to accustom oneself with that if stuff. And you don't have to understand at the first step how if is implemented. But even that is not as complicated as it might look. qif is the easier to start with. Yes it is a trick, but a straightforward one, not even a dirty one. And yes, we are interested to keep a close eye on server load, that's why qif as a replacement for if was created (by using qif, one call level is eliminated compared to if). And if developers and server maintainers flock in to report that we blow off the servers, believe me, we will kill if/qif immediately. But not due to a guideline that should be carfully reviewed for this special case. And please note that I do not intend to put up a fight. You and we, all of us care about the future of wikipedia. Nobody is interested to "press in" tricky stuff just for it's own sake. We care about building new solutions to existing problems. The way how to solve them (and the cognition of their existence at all) is what we differ in opinions. In good faith, – Adrian | Talk 18:08, 10 December 2005 (UTC)
- Is it really a good thing that only one editor knows what's going on with that template? -- Netoholic @ 15:32, 10 December 2005 (UTC)
- That's your POV, I belive User:Garzo knows what he do, he is a linguist specialist →AzaToth 15:21, 10 December 2005 (UTC)
- Well, seeing as I have been mentioned above, I'll let you know the history of {{language}}. The flexibility that the use of {{if}} allows was discussed long before that template was available. We had tried a number of ways of creating a modular template that could fit the great diversity of all language articles, but these hadn't worked. The other users of the template have appreciated the new flexibility that these templates have provided. I have tried to explain what I am doing as I go along, and, as I know nothing about computer programming, I am not being obscure for the sake of it. We weigh up the options of whether we want the template to do all we want it to do, or whether we want it to be easy to edit. I would love it, if there were a possibility of incorporating both options, but there isn't, and we have chosen flexibility above ease of editing. In the meantime, there are a few editors around who have acquainted themselves with the template, and feel able to make changes whan they are needed. In summary, the present state of {{language}} is the work of a linguist rather than a computer programmer, cobbling together the scraps of possibilities of template construction to make an infobox as good as possible. I'm writing an encycolpaedia... --Gareth Hughes 18:56, 12 December 2005 (UTC)
Another view
I did some check in the source code to see how mediawiki uses templates. When a page is using a template, that particular template is cached for actual page, so multiple uses of an template on a particular page uses only one fetch for this template. For an example, a book reference, is would then better to use an generic reference that have separate templates for different styles. (If the generic reference template only use for example {{qif}} then there will only be one fetch for actual page) →AzaToth 21:53, 10 December 2005 (UTC)
Can try to explain it a bit further:
- We have the template Generic that utilize the "logic" template logic multiple times, and it replaces the usage of template Specific-1 to Specific-n, which does not use any aditional templates.
- If Article only uses Specific-1 it's faster than using Generic.
- If Article uses both Specific-1 and Specific-2 there is no difference.
- If Article uses more than two Specific templates, it's faster to use the Generic version.
- If another template used by Article utilizes template logic, then the cost of Generic is reduced one step etc...
→AzaToth 22:21, 10 December 2005 (UTC)
- Yeah that sounds damned interesting! Thanks for looking at that. You're really smart (no pun intended). I have to ruminate that further. I just wonder what the other template geeks (like SEWilco) are doing. The tangent I'm on gets bigger and bigger. Interesting. It all started with wondering me how to reference a book on an article....:-) Oh my! – Adrian | Talk 23:20, 10 December 2005 (UTC)
- Interesting. This would suggest, for a start, that all of the various infobox templates should be moved away from using the logic templates if possible (since those are, by definition, used only once in an article). —Kirill Lokshin 01:46, 11 December 2005 (UTC)
- That might be correct, but personally I think it's cheaper to do one extra meta-call (to the template logic in this case), than to hide a lot of text using class hiddenContent, also, if there are other templates on the page using the template logic (for example a reference template), then there would be no saving going from logical templates. →AzaToth 02:00, 11 December 2005 (UTC)
- I think it's exactly the opposite. Because the call to if (et al.) is cached per article, it does not matter whether we have 500 if calls rooted directly (does not apply now) or indirectly on the page. We can have 100 instances of let's say book reference on a page. Even if qif appears several times in book reference (22 times to be exact, at the moment), as per the findings of Carl (=AzaToth) it is loaded exactly *once* per page (not 100 x 22 - ok would possibly not be 22 because not all branches are evaluated, it depends on the parameters fed into each specific template call). I hope I got that right (please correct me if I'm wrong). That's very cool! – Adrian | Talk 09:57, 11 December 2005 (UTC)
- Don't worry too much about there being several types of citation templates, they are being consolidated. It probably is more important for this discussion that citations have to deal with the fact that including or omitting information requires various formatting details be included or omitted. The logic templates are at present the only tool for doing that formatting, and infoboxes have similar formatting needs If wiki adds some builtin logic it will be trivial to change the few templates. However, that is not the only possibility, as another possible solution is some sort of tool similar to a "report generator" which would allow specification of the format of data display. For citations there have been various proposals for information handling, and it is possible someone will come up with tools with other solutions (whether specific to citations such as a publication-name-selector or a more general tool such as Jimbo's data retriever ("name of capitol city of country X"). (SEWilco 06:10, 11 December 2005 (UTC))
- Don't worry too much about there being several types of citation templates, they are being consolidated - can you point to where that's happening (out of curiousity)? Dan100 (Talk) 08:40, 11 December 2005 (UTC)
- I hope SEWilco allows me to step in: see Template:Citation (talk). But please do not use that in articles yet. As per SEWilco (who thankfully started that) who intends it do be for testing and development for now. But I think we can have a look at it, as it is not under user-space. Citation has just got more attraction as per the findings of AzaToth (in this thread). – Adrian | Talk 10:07, 11 December 2005 (UTC)
- There are ongoing changes to the various citation templates which will affect the consolidated template. A number of the changes involve logic incantations. (SEWilco 15:27, 11 December 2005 (UTC))
- The consolidation of citation templates is also visible in the History of WP:CITET. The availability of optional parameters has allowed reduction in the number of citation templates to perhaps 20-30% of the number which used to exist. Unfortunately, this also has increased use of if/qif so as to display text and punctuation needed by various optional fields. Consolidation has been slowed by the need to standardize parameter names, conversion of existing calls, and non-technical demands such as consensus finding and devoting time to Arbitration threats. (SEWilco 09:26, 13 December 2005 (UTC))
Proposal for "lazy templates"
As we have noticed, there is some concern that meta-templates which are defined as templates that include calls to other templates have some drawbacks which are described in the associated article.
Recent development around the templates template:book reference or template:web reference which include calls to so-called "logic templates" like template:qif have triggered some partly hefty reactions among some wikifolks. These logic templates haven been deemed by some as beeing a "kludge" or just "ridiculous" and for beeing a violation of this guideline here.
Some wikifolks insist that templates like template:book reference do add real value to wikipedia and its development, as they increase the quality of articles and do help non-wiki experts to write correct citations. What's also clear is that calls of template:book reference can easily be converted to anything else by a fairly simple bot. This includes possible future extensions. It is also relatively simple to convert those calls back to the old style low-level kind of citations that have been done by using wiki syntax only (without the use of templates). But the other direction is far less easy to do. So articles that today contain calls to template:book reference are - from an entropy standpoint - more valueable than those who do citations the old-style way (if we look at the wiki source).
Today, there are about 3000+ articles that already use template:book reference. If we come to the conclusion, that this guideline here rules, we can see that template:book reference has qualities of a "meta-template" as it uses template:qif. Some wikifolks have come to the conclusion that template:book reference cannot be implemented without using template:qif. So if this guideline here rules, this would mean the shutdown of template:qif and in turn the shutdown of template:book reference. The consequense of this would be that all calls to book reference would need to be downgraded to pure old-style wiki source.
One of the mentioned problem areas of the so called "meta-templates" is that - as it seems to be implemented now in the Wiki-software - if a template T is changed, all article pages that contain calls to T get their cache invalidated. As Jamesday describes in the article here, this can be a resource consuming task. This can also result in operations enduring in the order of several tenths of seconds.
A well known mechanism to circumvent this is "subst", where a template is instantiated at the moment the editor clicks on save. The problem with subst is, that it cannot be applied to book reference, as the result is just a bunch of qif expressions that nobody can manage by hand.
It must be noted that reckless editing of template:book reference is not desired anyway. So it is expected that book reference stabilizes more and more and there should be the longer the more less reasons to change it. This is even more true for template:qif, which is even more stable. So rippling changes originating from template:qif today already are a rare case. So beeing dependent on stable stuff is not that bad.
What remains are changes in template:book reference.
I would like to present the following idea: Why not ignore changes in template:book reference at first for some time and leave that cache invalidating step away completely. It does not hurt if articles referencing template:book reference use an old version of it. This can wait until somebody edits an article or until a slow bot comes by and invalidates that article's cache (within 24 hours or so). That bot could run at off-peak hours. I would call this feature a "lazy template". Maybe template:book reference (and template:web reference) could be marked in some way as "lazy templates". This could also be seen as a more luxory form of "subst" that preserves the entropy of the wiki-source of an article. – Adrian | Talk 17:03, 11 December 2005 (UTC)
- See also the thread on the mailing list wikitech-l. – Adrian | Talk 18:53, 11 December 2005 (UTC)
- Server caches of pages can be manually purged. See template:purge, Misplaced Pages:Purge. – Adrian | Talk 23:00, 11 December 2005 (UTC)
Removing guideline status
There is no evidence that Misplaced Pages:Avoid using meta-templates ever had community consensus. No polls or discussions were held on the issue that I am aware of. In fact, with the exception of User:Netoholic (its author) and about three or four other users, virtually all of the comments regarding it have been negative. Furthermore, it was written as a very specific response to a technical issue with MediaWiki server capacity circa early 2005. No evidence has been adduced that this is still the case. The guideline status seems to be primarily an excuse for Netoholic to engage in revert warring and to carry out a jihad (or crusade, if you prefer) against templates he doesn't like for whatever reason. Until I see evidence of consensus, I'm removing the guideline status. Firebug 20:35, 12 December 2005 (UTC)
- It's still the case. Using resources unnecesssarily is not helpful. Jamesday 20:35, 17 December 2005 (UTC)
- This is patently obvious.
- On the other hand, writing an encyclopedia requires us to use resources. The scuffle here isn't about whether we should heedlessly waste server resources or not; everyone agrees that we shouldn't. The contention is about which tasks are "unnecessary".
- We could conserve resources even more by turning off search, images, visual styles, red link checking, and editing, but we're not doing that because we'd have nothing of value left. On the other hand, we could streamline the process by using templates and shortcuts for anything (that the developers don't have time to code into a real feature) that makes it easier for newcomers and non-hackers to contribute content, but we're not doing that because of the server load. The problem still needs to be clarified (in detail) by the developers: Where do we draw the line?
- No one's trying to vote away technical problems. We're trying to decide how much crippling of the encyclopedia-building process is necessary to avoid crippling the encyclopedia-hosting process. — Omegatron 02:16, 18 December 2005 (UTC)
- There is just a problem with consensus: as David Gerard correctly points out, we cannot vote whether the servers can manage meta-templates or not. So we need statements from experts (those that run the servers, for example) and specific examples of meta-templates. I do not have a problem with this being a guideline. A guideline, not a policy. Disclaimer: I'm an aficionado of template:qif and template:book reference (a meta-template). – Adrian | Talk 23:54, 12 December 2005 (UTC)
- One mitigating factor for the logic templates is that once they are stable, they can be protected and not changed, thus removing most of the odds of them cache-invalidating lots of pages if changed. —Matthew Brown (T:C) 00:54, 13 December 2005 (UTC)
- MediaWiki server capacity improvements are a continual race against increasing usage. Profligate waste of server resources is never a good idea. IMO, this guideline should really be reworked into a "don't waste server resources" guideline. Templates invoking templates invoking templates invoking templates for no particular point is a bad idea. Simple is better. I've asked Jamesday to comment. -- Rick Block (talk) 01:21, 13 December 2005 (UTC)
- Why does everyone say we need developer input... we have! I'm not here to say that you can't get more input from them, but it seems this Talk page wants to make it a requirement that the developers check in every couple months just to keep this a guideline. The correct approach would be to respect their previous input UNTIL you hear differently. Meta-templates should be avoided - I doubt there will ever be a time where that guideline will change. What seems to be the point of contention is how they should be avoided (subst:ing, multiple similar templates, CSS tricks). Don't confuse the two issues, and you'll be far better off. -- Netoholic @ 03:17, 13 December 2005 (UTC)
- That's because this proposed guideline makes the job of Misplaced Pages template editors significantly harder, and therefore it should be subject to severe scrutiny to ensure that it is absolutely necessary. Simply saying that something might increase the server load isn't enough to mean it shouldn't be done. After all, we could dramatically reduce the server load by turning off images completely, but I don't recall anyone making a page called Misplaced Pages:Avoid using images. Being able to nest code is a elementary programming feature, and if the MediaWiki software can't handle it without a performance hit, that should be treated as a serious bug that needs to be addressed, not something that users should have to continually work around. I am not at all convinced that the server situation remains unchanged in the past 10 months. Firebug 03:48, 13 December 2005 (UTC)
- It's a guideline, not a policy. So if you have very good reason not to follow it, don't follow it. But it's ok to think four times before violating it. If the developers would have been that shure as they are claimed, then they would have made it a policy. – Adrian | Talk 10:59, 13 December 2005 (UTC)
- No. All of this violates basic programming principles. Every programmer knows that hard coding is a ugly, godawful thing to do, but you're urging that it be made Misplaced Pages policy. (And subst is a form of hard coding - since changes from the template don't automatically propagate.) What we should be talking about is how to add new features like inheritance and polymorphism to the MediaWiki engine - not getting rid of the most basic functionality that was taken for granted in the 1980s. Firebug 03:48, 13 December 2005 (UTC)
- Quite true. I'll remind you, though, that what we're writing here is markup, not code—and while we need a few semi-clever tricks to get the markup right, I can't for the life of me imagine why we would ever want to use polymorphism, for instance. (On another note, this would likely make templates utterly unreadable to anyone without a CS degree). —Kirill Lokshin 04:07, 13 December 2005 (UTC)
- I will admit I was being a bit deliberately provocative with my comment about polymorphism. But that's not the point. In many cases, nesting templates can make template code easier, not harder, to read. We should not have a policy that encourages editors to write unmaintainable spaghetti templates and hard-coded shit. And using subst: is a hack because it makes further editing more difficult and prevents template changes from propagating, as with transclusions. Even a markup language should be able to handle basic nesting of calls. This ain't rocket science. Firebug 04:25, 13 December 2005 (UTC)
- Have you ever actually read all of Jamesday's comments on this very talk page, or are you just deliberately dismissing them? -- Netoholic @ 04:49, 13 December 2005 (UTC)
- Well, it does handle them; obviously, this has associated costs (just as nested function calls in code do). In this case, at least at the time this page was written, the resource cost wasn't worth the benefits of using nested calls; it remains to be seen, based on developer input, whether this is still the case.
- As an aside, most templates are merely blocks of markup: tables, frames, etc. Only a few templates—the citation ones, for instance—truly benefit from nested calls as opposed to some other method of hiding undesired markup; and some of them would likely be better off as MediaWiki features rather than templates. The citation templates, for instance, are basically a wizard to produce a proper citation based on some parameters; once the citation is inserted into the page, we generally don't want it to change appearance. —Kirill Lokshin 04:33, 13 December 2005 (UTC)
- It's still the case. As for your programming arguments, you might want to consider the relative efficiency of loop unrolling and inlining instead of loops and function calls. Those optimisations are what subst is equivalent to. Very little text needs to be instantly updatable on the whole site. Where it is not necessary, subst is a more efficient way of doing the job. Jamesday 20:35, 17 December 2005 (UTC)
- To Netoholic's point about asking for developer input - I'm reasonably certain the basics for how pages are constructed has not changed in the last year. My understanding is that if the page is not cached, some Apache server makes a database fetch for its contents and database fetches for each template that must be interpreted in order to build the page contents. I think doing any less work than this is likely to be very difficult. There's ultimately a single database behind all wikipedia pages, and for pages that aren't cached, the database is almost certainly the true bottleneck (since we can add a relatively arbitrary number of Apache servers). A page that references no templates requires one DB fetch. A page that references a template that references a template requires three. We can buy all the Apache servers we want, but if they all have to connect to the same database the limiting factor is going to be the database. It was a year ago. I'm actually a bit surprised we're doing as well as we are. In any event, the point of all of this is that I'm not a MediaWiki developer and I suspect Netoholic isn't either. Certainly some things have changed in the past year. I think it's distinctly unlikely, but it's possible things have changed so that database fetches are not even close to the current bottleneck. The folks wanting to use templates in programmatic ways seem to want to optimistically believe this isn't an issue anymore. Developers know for sure. Asserting it isn't an issue without developer input seems ludicrous. Asserting nothing's changed in the last year that might help this issue without developer input also seems ludicrous. -- Rick Block (talk) 05:15, 13 December 2005 (UTC)
- My point is simply that a feature this useful and powerful should not be discouraged without a very good reason. Someone's suspicions aren't enough. See my analogy above - this is like asking people not to use images. The burden of proof should be on the anti-template crowd (who have no community consensus that I can see) to prove - not once, but continually - that so-called "meta-templates" make the server utterly impossible to maintain. Firebug 06:14, 13 December 2005 (UTC)
- About the Guideline discussion: For this subject, it seems the community of Developers (particularly of DB) are the ones who should decide on the Guideline status. I view many of the meta-templates as tools to achieve needed results using the current technology. If an application such as infoboxes with optional fields become popular, it is likely that an efficient Wiki tool will be created to replace it. However, limits have to be drawn someplace; AUM should prevent extremes such as a fad of everyone creating complex signature templates and then those also being accepted on article pages. We all want to avoid dealing with the ultimate authority on where the limits are: reaching the maximum capacity of the hardware. (SEWilco 09:14, 13 December 2005 (UTC))
- The hiddenStructure CSS trick can handle optional infobox fields (for now). It's not particularly elegant, but it's probably a good way of keeping meta-template usage limited to where it's really necessary. —Kirill Lokshin 14:09, 13 December 2005 (UTC)
- As far as I know, hiddenStructure only works with the monobook skin. People who use different skins have said they see the fields (as, for example Cinematography:{{{cinematography}}} in a page where that field doesn't exist for {{Infobox Film}}). - Bobet 20:32, 13 December 2005 (UTC)
- As of yesterday, that should no longer be the case :-) —Kirill Lokshin 20:34, 13 December 2005 (UTC)
- It also wont work if the parameter start with '" ' or contains the string " class="hiddenStructure"" etc... →AzaToth 20:36, 13 December 2005 (UTC)
- Thanks, I just went to test it out and thought I was crazy since it looked fine :). - Bobet 20:39, 13 December 2005 (UTC)
- As of yesterday, that should no longer be the case :-) —Kirill Lokshin 20:34, 13 December 2005 (UTC)
- As far as I know, hiddenStructure only works with the monobook skin. People who use different skins have said they see the fields (as, for example Cinematography:{{{cinematography}}} in a page where that field doesn't exist for {{Infobox Film}}). - Bobet 20:32, 13 December 2005 (UTC)
- The hiddenStructure CSS trick can handle optional infobox fields (for now). It's not particularly elegant, but it's probably a good way of keeping meta-template usage limited to where it's really necessary. —Kirill Lokshin 14:09, 13 December 2005 (UTC)
Community consensus is beside the point
The developers flat-out said "Avoid using meta-templates." The developers are given free reign to say "Please do not make our database collapse weeping." And then we, as editors, have to listen. And it doesn't actually matter how many editors don't want to listen - the developers remain empowered to implement guidelines like this. Phil Sandifer 06:46, 13 December 2005 (UTC)
- No, Misplaced Pages has substantial editorial problems (Siegenthaler, vandalism on George W. Bush) and anything that makes it harder to maintain is a dangerous distraction that imperils the whole project. Susvolans ⇔ 08:07, 13 December 2005 (UTC)
- Misplaced Pages is very hard to maintain when the database stops working. Though this is beside the point - just as you cannot vote or complain away the developer's right to say "Don't do this," you also cannot vote or complain away the fact that you are unable to do the former. Phil Sandifer 20:40, 13 December 2005 (UTC)
Perhaps the page title "Avoid" is where people are getting confused. Maybe we need to rename it something stronger like "Don't use meta-templates"? Or better yet, how about "Misplaced Pages:Template policy"? Let's nail down some of the rules related to template usage. -- Netoholic @ 06:16, 14 December 2005 (UTC) (revised)
- Wasn't it called "Meta-templates are considered harmful" once? Phil Sandifer 06:19, 14 December 2005 (UTC)
- Yeah, but that also confused some users and was a little softer than "Avoid". -- Netoholic @ 06:21, 14 December 2005 (UTC)
- I've renamed it per these suggestions. HTH. Radiant_>|< 23:42, 17 January 2006 (UTC)
- The policy does not ban meta-templates! That's why it was moved to "avoid" after Netoholic's comments (look at the page history and the timestamp on Netoholic's comment!). --DCrazy talk/contrib 23:57, 17 January 2006 (UTC)
- I screwed things up by trying to move this back to "Avoid using meta-templates". I wound up moving only the talk page, which I then mistyped in my efforts to move it back to "Misplaced Pages talk:No meta-templates". I panicked, but everything is back to normal. Now please move this page back to "avoid using meta-templates". --DCrazy talk/contrib 23:57, 17 January 2006 (UTC)
Something to read: m:Help:Parameter default
Hi folks! Let's have a break and learn something. For those who watch this talk page and enjoy reading new stuff: There is a nice new page at m:Help:Parameter default about all that new stuff which is at the heart of these new template tricks. Kudos to Patrick and AzaToth. (Sorry for the advertising here). Have fun reading (no pun intended)! – Adrian | Talk 21:30, 13 December 2005 (UTC)
- Boy oh boy... now if either one of them would learn how to write real code in PHP and become real developers, we might have a solution that we could use. -- Netoholic @ 21:38, 13 December 2005 (UTC)
- And in the interim we use what we have. Deal or no deal? :-) (please don't hit me! And have a look at Carl's box profile). – Adrian | Talk 22:22, 13 December 2005 (UTC)
- No, in the interim we work very hard to ensure these meta-templates are eliminated per this guideline. Does that mean some functions will require multiple templates? Sure. Does this mean some template will lose function? No problem. Will this bruise some egos? Doesn't matter. -- Netoholic @ 23:49, 13 December 2005 (UTC)
- First of all, as stated previously, let's see some evidence of developer consensus. I've heard about ONE developer (Jamesday) who has complained about meta-templates. And that was ten months ago. Are there any others? How serious (if at all) do they think the problem is at this time? What (if anything) are they doing about it? Until we know the answer to this, we can't proceed. Furthermore, doing away with nested templates altogether is utterly unacceptable. It's like proposing we do away with images. IF the developers need template use reduced as a TEMPORARY hack to reduce server usage, then we can start with templates that can easily be rewritten to avoid metafication. Breaking existing functionality should be an absolute last resort, yet you go about it with an unseemly glee. You should be banned from ever having anything to do with templates on Misplaced Pages ever again. Firebug 04:36, 14 December 2005 (UTC)
- BTW, on Aug 6 of this year, Jamesday wrote (from the main article): "There are changes in 1.5 which will help. How much is currently not known." Are we running that now? Did it fix the issue? If the issue is resolved, then all of this bullshit should stop and people should use any kind of templates that make things easier. Firebug 04:40, 14 December 2005 (UTC)
- So basically unless the developers personally continue to notify you that it is a problem, you're going to assume it goes away on its own? Phil Sandifer 05:04, 14 December 2005 (UTC)
- Well, no. When the developers said a couple months ago that the new software update would fix the problem, and when the only person who is openly complaining about the use of these templates isn't even a developer at all, I'd like to get some sort of statement from the developers regarding the issues raised above. I don't need personal notification, but I think the Wikicommunity as a whole should get updates on this. When was the last time the developers were asked about the impact of nested templates? Has MediaWiki 1.5 been rolled out yet? I AGREE that the technical issues are important - and they are being overlooked due to Netoholic's insistence on shoving things down people's throats. Firebug 05:14, 14 December 2005 (UTC)
- I generally assume that the developers are too busy to let us know when they have not fixed a problem, and thus to assume that no news is bad news. In the absence of any evidence whatsoever that the problem has fixed, perhaps you might undertake bothering the developers, as I, at least, am rather too polite to do so with questions that they have already answered. Phil Sandifer 05:18, 14 December 2005 (UTC)
- Where can I obtain Jamesday's email address? I would like to (politely of course) ask him if MediaWiki 1.5 is in use and if this has fixed the "meta template" issues and to what extent. If devs agree the issue is fixed with the newer software, can we get rid of this nonsense? Firebug 05:25, 14 December 2005 (UTC)
- I have faith that you can figure out how to contact User:Jamesday. Phil Sandifer 05:26, 14 December 2005 (UTC)
- Where can I obtain Jamesday's email address? I would like to (politely of course) ask him if MediaWiki 1.5 is in use and if this has fixed the "meta template" issues and to what extent. If devs agree the issue is fixed with the newer software, can we get rid of this nonsense? Firebug 05:25, 14 December 2005 (UTC)
- I generally assume that the developers are too busy to let us know when they have not fixed a problem, and thus to assume that no news is bad news. In the absence of any evidence whatsoever that the problem has fixed, perhaps you might undertake bothering the developers, as I, at least, am rather too polite to do so with questions that they have already answered. Phil Sandifer 05:18, 14 December 2005 (UTC)
- Can we please relax about this? Jamesday has been asked to comment. I don't think anyone is arguing real problems should be ignored. My suspicion is that this is not a black or white issue, and that the truth is that every little bit hurts and no one (not even the developers) exactly know how much is too much. Yes, we use images. Yes, we'll use some meta-templates. If we can avoid both of these, we'll need to buy fewer servers. The guideline says "avoid". It doesn't say "seek out and destroy all". Don't do things that consume resources unless there's a good reason to do so. Repeat after me - "duh". -- Rick Block (talk) 05:32, 14 December 2005 (UTC)
- I was responding specifically to Netoholic's "salt the earth" comment above, where he said that even if it breaks things we should get rid of all "meta templates". You may be right that the truth lies somewhere in between. It would be helpful to know the extent of the issue as things currently stand, so we can decide just how much effort should be put into this. Firebug 05:40, 14 December 2005 (UTC)
- A very wise statement. Thanks for that. And I do apologize for having added fuel to the fire. At least it was worth a try. In the mean time I might see whether I can ameliorate things a bit by replacing calls to if with the server friendlier qif (one less meta-level, thanks to AzaToth). We might then even be able to delete if. At least this would not hurt the servers. I know that this might be in vain if qif should get abolished. Just a try. – Adrian | Talk 08:47, 14 December 2005 (UTC)
Why Templates in templates not switched off?
David Gerard wrote "The only reason templates in templates aren't switched off entirely is because they're needed for a few specific purposes."' Can somebody please list these? Which meta-templates qualify for these "few specific purposes"? What are the requirements to qualify for "few specific purposes"?
I'm just asking this because I wonder why we got into all this trouble if meta-templates are that bad? Why haven't they been switched off? Why is this article here not a policy with a list of exceptions?
Sorry for asking, I'm relatively new to Misplaced Pages. I came to all this because I wondered how to add a book reference to an article. After some search I found template:book reference and just used that. Then I wondered why it's not used in more articles and just started slowly to use it on a few articles. After receiving no objections, I just continued a bit. Then some smaller problems around book reference occured and I suddenly was in the middle of template wonderland.
What I cannot understand, as a newbie, is that how is it possible that a technique which seems to be that dangerous can "slip" into thousands of articles without noticing by any of the proponents of the "don't use meta-templates group"? Why did Misplaced Pages not make this a policy at first hand and list the allowed exceptions or even shut down templates in templates completely? I simply do not understand.
Why do you attract people and do not take more care that they cannot do that harmful things to the servers. Why does wikipedia attract people by saying be bold and beat them afterwards. I think there must be something wrong. I just do not understand that. What I also not understand is, that I haven't seen any of the "don't use meta-templates group" appearing on the talk page of book reference. It's been there quite some time already.
Sorry for my silly questions. Sorry for the long post. I'm just a newbie trying to understand the wonders of wiki-land. Please note that it is not my intention to put a fight. And my ego does not care whether Misplaced Pages uses meta-templates or not. I'm just puzzeling. And I just stayed here because I found some really great articles and some bright people. – Adrian | Talk 12:09, 14 December 2005 (UTC)
- Misplaced Pages and the MediaWiki software and the hardware complex that runs it grow organically, based on strictly volunteer contributions (cash in the case of the hardware). The template mechanism was introduced in the software to address the need for a way to include similar (identical) content in multiple places without reentering it. The way it was implemented allowed template references to be nested. Contributors, being clever, have figured this out and have defined lots of templates that use other templates. Meanwhile, Misplaced Pages's popularity has been increasing exponentially. It is now one of the most highly viewed sites in the world (Alexa says more than 1000M page views per day ). The software and hardware architecture have evolved in response to increasing load (see m:Wikimedia servers) to the point that I would assert wikipedia.org is one of the most sophisticated web sites in the world (note the basic problem - anyone, anywhere, can edit any page and their changes are immediately visible, combined with tremendous "view only" traffic - is much more difficult than high traffic "view only" sites like microsoft.com). The developers don't get paid. The server admins don't get paid. I believe there's one person who is paid who is in charge of the IT infrastructure. To keep the site running reasonably responsively there's an ongoing effort (again volunteer) to add more servers and analyze and improve the software efficiency. user:Jamesday is one of a handful of people (volunteers) who do this. He noticed templates including templates can cause bad performance effects, which resulted in this guideline. In general, the things done to improve performance are done without affecting user operation (turning search off being a notable exception). Turning off template inclusion of templates at this point would break lots of articles, so is clearly not a desirable solution. Is template inclusion of templates a significant performance issue at this point? I don't know. I do know that general performance is, and almost certainly always will be, a BIG issue. -- Rick Block (talk) 16:45, 14 December 2005 (UTC)
- That's really impressive. And shocking too. I feel the point of no return in re if has already passed. And to handle that by consensus does not work. Maybe it would be best to face the situation and put all efforts in implementing that in code instead of argumenting about how to throw it out. But I don't know how long that would take. However, this discussion here is just academic. By yelling at newbies Netoholic just pisses them off. Maybe he also hits that one who could implemement it. They just do not understand him. And the rate he does this is clearly insuffient to solve the problem. Being bold does not solve this. – Adrian | Talk 18:18, 14 December 2005 (UTC)
- I don't think that means anything, really. Perhaps it's too late to remove {{if}} outright—but that certainly doesn't mean its spread cannot be controlled.
- In other words, we may need to keep {{if}} in order to maintain the various reference templates; but that's no reason to thoughtlessly insert it into every template we can find. In particular, the various userbox templates seem to have been infused with logic extensions—and why? They're not really part of the encyclopedia proper; to stress the servers for the sake of a little extra eye candy on userpages seems shortsighted. —Kirill Lokshin 18:36, 14 December 2005 (UTC)
- Template:if should be aggressively removed from every userbox template that it is in immediately. Phil Sandifer 19:57, 16 December 2005 (UTC)
- According to WP:UBX so is no userbox there using {{if}}, one ({{Userbox/Vandalized}}) is using {{qif}} →AzaToth 20:51, 16 December 2005 (UTC)
- Are you trying to be funny? Here's a great example of what needs to go far away. {(if}}, {(switch}}... it's all the same. -- Netoholic @ 20:57, 16 December 2005 (UTC)
- I'm not trying to be funny, Phil said if. Also, it's more server friendlier to use switch in a generic userbox than to use several different userboxes per meta call perspective (called templates are cached so only one database lookup per template is issued per session) →AzaToth 21:04, 16 December 2005 (UTC)
- "Templates" are not cached in any way. Pages are gathered from their various components, parsed, and then cached as HTML. Read Misplaced Pages:Avoid using meta-templates#How a page is built and cached. Each time a user page is edited, all templates and sub-templates it contains are pulled from the database. A template with 10 {(switch}} calls creates ten identical database calls and gets ten identical results. It then mashes those results into the userbox template result, and then incorporates that in the final page. The completed HTML page is then written to cache. -- Netoholic @ 21:19, 16 December 2005 (UTC)
- You have wrong, perhaps it's a so new change in the software that you are unaware of it, but template are catched. on line 108 on includes/Parser.php, it states:
- "Templates" are not cached in any way. Pages are gathered from their various components, parsed, and then cached as HTML. Read Misplaced Pages:Avoid using meta-templates#How a page is built and cached. Each time a user page is edited, all templates and sub-templates it contains are pulled from the database. A template with 10 {(switch}} calls creates ten identical database calls and gets ten identical results. It then mashes those results into the userbox template result, and then incorporates that in the final page. The completed HTML page is then written to cache. -- Netoholic @ 21:19, 16 December 2005 (UTC)
- I'm not trying to be funny, Phil said if. Also, it's more server friendlier to use switch in a generic userbox than to use several different userboxes per meta call perspective (called templates are cached so only one database lookup per template is issued per session) →AzaToth 21:04, 16 December 2005 (UTC)
- Are you trying to be funny? Here's a great example of what needs to go far away. {(if}}, {(switch}}... it's all the same. -- Netoholic @ 20:57, 16 December 2005 (UTC)
- According to WP:UBX so is no userbox there using {{if}}, one ({{Userbox/Vandalized}}) is using {{qif}} →AzaToth 20:51, 16 December 2005 (UTC)
- Template:if should be aggressively removed from every userbox template that it is in immediately. Phil Sandifer 19:57, 16 December 2005 (UTC)
$mTemplates, // cache of already loaded templates, avoids // multiple SQL queries for the same string
- →AzaToth 21:23, 16 December 2005 (UTC)
- You said it right... "multiple SQL queries for the same string" - multiple occurances of {(stub}} are held in the parser... but parameterized templates are not all the same string. Take this example. {(userbox|...}} is called 19 times because the string changes each time. -- Netoholic @ 21:32, 16 December 2005 (UTC)
- They are added to the cache as verbatim, it checks in the cache if the template name is present, if present it sets $text to it and parse it, else it makes a sql call. (see line 2420 in same file) →AzaToth 21:44, 16 December 2005 (UTC)
- Wrong again. -- Netoholic @ 21:59, 16 December 2005 (UTC)
- Netoholic is correct. That particular cache is local, and exists for the length of the script's execution, or rather, for the length of that particular parse. It mitigates needing to hit the DB four times if four calls to {{Template:Foo}} are made within one article, for instance. Rob Church 22:34, 31 December 2005 (UTC)
- They are added to the cache as verbatim, it checks in the cache if the template name is present, if present it sets $text to it and parse it, else it makes a sql call. (see line 2420 in same file) →AzaToth 21:44, 16 December 2005 (UTC)
- You said it right... "multiple SQL queries for the same string" - multiple occurances of {(stub}} are held in the parser... but parameterized templates are not all the same string. Take this example. {(userbox|...}} is called 19 times because the string changes each time. -- Netoholic @ 21:32, 16 December 2005 (UTC)
- →AzaToth 21:23, 16 December 2005 (UTC)
- If userboxes are creating any sort of server load, they should be shot on sight - they are as wholly a non-essential function as can be dreamed up. We ought not have to play "Which way of doing this totally useless function is less destructive." Phil Sandifer 21:12, 16 December 2005 (UTC)
- I don't think userboxes are to much of a worry, they are only used on low traffic pages (userpages) →AzaToth 21:21, 16 December 2005 (UTC)
They also tend to be used multiple times on userpages. Furthermore, there is absolutely no reason why they should need to use meta-templates. "This user is X" is a simple enough thing to communicate without being l33t. Phil Sandifer 21:26, 16 December 2005 (UTC)
- That's why I created userbox foo using switch to reduce the relative number of sql calls if multiple simlar boxes are used on one page →AzaToth 21:29, 16 December 2005 (UTC)
- By far the easiest thing to do, though, is to just subst the templates. Phil Sandifer 21:42, 16 December 2005 (UTC)
- I think people can get rather angry if you start to subst on their user pages. →AzaToth 21:48, 16 December 2005 (UTC)
- Aza... you should be trying to help us reduce the server load. Instead, you are just expanding this practice directly in the face of better judgement. You've made it so that several templates can't even be subst'd anymore (Misplaced Pages:Template substitution#Templates that should NOT be subst'd). You're making a mess that you know you won't have to clean up.
I vote we just bite the bullet, blank and protect these damn "logic" templates. The trivial purposes we're using this for are not worth it all, and the use is expanding daily. -- Netoholic @ 21:59, 16 December 2005 (UTC)- That will likely confuse people - how about if we change them to read something like "You are seeing this text because this template uses a deprecated meta-template. Please correct its usage" so that at least people know what happened. Phil Sandifer 22:03, 16 December 2005 (UTC)
- Well, neither way would be pretty, but either would inspire some quick work either restoring older templates/versions to use. I can find alternatives for every instance of meta-template use. The technical side isn't the problem... it's the people that openly defy this guideline. I mean, I can understand disagreeing, but actually expanding these things at this point is just reckless. -- Netoholic @ 22:27, 16 December 2005 (UTC)
- That will likely confuse people - how about if we change them to read something like "You are seeing this text because this template uses a deprecated meta-template. Please correct its usage" so that at least people know what happened. Phil Sandifer 22:03, 16 December 2005 (UTC)
- Aza... you should be trying to help us reduce the server load. Instead, you are just expanding this practice directly in the face of better judgement. You've made it so that several templates can't even be subst'd anymore (Misplaced Pages:Template substitution#Templates that should NOT be subst'd). You're making a mess that you know you won't have to clean up.
- I think people can get rather angry if you start to subst on their user pages. →AzaToth 21:48, 16 December 2005 (UTC)
- By far the easiest thing to do, though, is to just subst the templates. Phil Sandifer 21:42, 16 December 2005 (UTC)
related debate
The relevance of this guidelene is being debated at Template talk:Spoiler#Misplaced Pages:Avoid using meta-templates. People intested in these issues would be welcome to comment there. DES 18:33, 14 December 2005 (UTC)
- Don't let this turn into a MeatBall:ForestFire. Discuss the WP:AUM guideline here... talk about possibly merging the spoiler templates there. -- Netoholic @ 18:56, 14 December 2005 (UTC)
- Since the queastion about whether the AUM guideline applis to the spolier templates, and indeed to the IF logic templates has been raised there, it seems that it is a courtesy to let intersted and possibly knowlegable people here know about the discussion there. This was more in the line of posting a notice of a relevant ongoing discussion in another plce, such as is often done on the pump, or via RFC. I fail to see how that is ignigting a "forest fire" (and given the size of wikipedia, i don't see that discussion on several pages has the kind of problems that MeatBall was complaining about anyway. My only experince with a case where someone cited that "guideline" was in what I continue to regard as an improper attempt to stifle valid discussion, so I do not react positively to the reference.) I might add that you are the person who raised the issue of AUM on Template talk:Spoiler, and used it as the basis of a revert, to boot. DES 19:04, 14 December 2005 (UTC)
A small point
Templates are needed for consistency. Compare the situation where we have templates A and B. If they call a template C implementing the common denominator, and it gets edited, then, true enough, all pages containing A and B will need to be re-rendered. But if they don't call C, and A is changed then B must be changed as well. In case of several similar templates this is prone to error (I'm sure you can imagine what can go wrong). All pages containing A and C still need to be re-rendered. Fortunately most of the templates like C will not need changing frequently. That templates are a vandal-magnet is a problem all by itself. Suppose someone would put something nasty on disamb? Perhaps it would be better if we only allowed high-frequency templates to be changed only by registered users who have been around for a while. But that's probably to unwiki of me. Another thing: might it be possible to make only that part of a page affected by a template re-render if that template changes? That would solve a lot. Also if an article is edited and only stuff outside template calls changes, they wouldn't need to be called again, would they? I know, our develepors are busy enough as it is, but hey, one can dream (or have a wishlist). Shinobu 19:55, 16 December 2005 (UTC)
- Yes, if A and B have a commonality that is changed without a template the net number of articles to be re-rendered is the same, BUT if it's done by modifying a common template C the software immediately marks cached versions of all of the articles as being out of date. With templates using templates, this can result in a tremendous burst of activity that is smoothed out somewhat if instead several templates are modified each affecting only a subset of the total number of articles. The software could keep a queue of cache invalidation requests and meter them to a reasonable rate (even do them asynchronously to the change of the template), but I'm guessing this would be a fairly tricky change to get right. Re-rendering only part of a page is not possible given the current hardware/software architecture (the squid servers, which are the primary caching mechanism, work by caching entire page contents). This could potentially be done using features fairly recently added to the squid software, but again it wouldn't be easy. I think the bottom line is that the developers know there's interest in this, they would like to do something if they could, they aren't stupid, and it hasn't been done - my take-away is that it must be VERY hard. -- Rick Block (talk) 23:57, 16 December 2005 (UTC)
Hm. In that case I think it will probably be solved at some point, since we actually do need it. Shinobu 21:01, 19 December 2005 (UTC)
Incorrect example
Neither {{Metastub}} nor the stub tempaltes (not categories) created using it, nor stub types in general, are or use meta-tempaltes in any way, so they are not appropriate for mention here. Furhtermore, new stub types are normally subject to a proposal and approval process, precisely to avoid "scope creep" and "spur-of-the-moment" creation of new stub types, see WP:WSS/P. As a result i think the entire "scope creep" section is invalid, as the removal of this clearly incorrect example leaves it without any example at all, and deprices it of what the project page says is currntly the principle example. If that is the principle example of meta-tempalte involvement in scope creep, there is none. DES 22:42, 16 December 2005 (UTC)
- While the specific examples are perhaps out-dated (thanks to this guideline's existence), we have much BIGGER fish to fry lately and the section should remain, but be updated. Latest evil-doers can be found at Category:Misplaced Pages special effects templates and WP:UBX. UBX is a particularly good "scope creep" example. -- Netoholic @ 22:48, 16 December 2005 (UTC)
Offer of assistance
I would like to offer my assistance to anyone looking for ways to make a template work while also following this policy and general good practices. Please contact me on my talk page and describe what you're trying to achieve. I also run a bot which can assist with some conversion/migration tasks. -- Netoholic @ 07:34, 18 December 2005 (UTC)
- Maybe you could put that on your user page? Maybe with some pointers to your works (maybe with examples)? Thanks for the offer. Maybe I could ask for some bot run in the future. I didn't recognize that you also operate one. – Adrian | Talk 09:13, 18 December 2005 (UTC)
Maintainability and liability
There is a saying in the computer programming world: “Premature optimisation is the root of all evil”. While a reasonable degree of responsiveness (which Netoholic’s revert warring does nothing to promote) is worthwhile, aggressively attempting to optimise the servers at the expense of maintainabilty ties up the time and work of editors. Even for editors such as myself who prefer to work on editing other people’s work, it is busywork and a distraction from checking core quality. Some people underestimate the importance of useful back-editing in handling the rubbish (and libel; the John Siegenthaler incident isn’t a worst case) that Misplaced Pages absolutely must keep under control if it is to survive. Susvolans ⇔ 16:27, 18 December 2005 (UTC)
- This policy has been on the records for months and has been systematically ignored. I see little reason to call a clean up at this point premature. Phil Sandifer 17:17, 18 December 2005 (UTC)
- Susvolans, you may disagree with this policy but then you don't need to do any work. All you need to do is allow me and others to do this "busywork" of cleaning up meta-templates. My biggest barrier right now is people reverting my efforts. Go work on articles, and I'll (we'll) fix the templates. -- Netoholic @ 17:46, 18 December 2005 (UTC)
- The busywork I was talking about was maintaining by hand pages that have long text instead of templates. Susvolans ⇔ 17:49, 18 December 2005 (UTC)
- All well and good that you don't want to do this. The developers have asked you to do it anyway, however. So do it anyway. Phil Sandifer 17:50, 18 December 2005 (UTC)
- I agree with Susvolans. To Susvolans: I would propose to stop discussing here. It is pointless. We now have 21'000+ articles that depend for example on template:if or its server friendlier replacement template:qif (most via meta-templates). This is 2.6% of all wikipedia articles. That's a fact. It can't be stopped anyway. It might pass a TfD and then it might go to the holding cell. And then? Good luck in fixing 21'000 articles! – Adrian | Talk 19:06, 18 December 2005 (UTC)
- Actually, I suspect that, having just killed Template:If without removing it at all, the damage will be cleaned up by the users by dinner. Phil Sandifer 19:27, 18 December 2005 (UTC)
- Yes. because I have it almost converted to qif. So why don't you kill qif, please? I'd love to watch this! – Adrian | Talk 19:42, 18 December 2005 (UTC)
- Please refrain from rejoicing at demonstrations of denial of service attack vulnerabilities. Doing so, and deliberately acting in ways known to make them worse, despite repeated requests not to do so, is unhelpful. Jamesday 20:27, 18 December 2005 (UTC)
- Seconded. That would be the precise phrasing I was grasping for - David Gerard 20:36, 18 December 2005 (UTC)
- To give you an idea of how bad these templates are, killing if locked the database briefly. Phil Sandifer 19:44, 18 December 2005 (UTC)
- At least I do not have to work on converting if to qif any longer. Thanks! – Adrian | Talk 19:48, 18 December 2005 (UTC)
- Way to be a team player... -- Netoholic @ 20:33, 18 December 2005 (UTC)
- Please instead work at reducing the use of qif to reduce the harm. Jamesday 20:27, 18 December 2005 (UTC)
- I hope that this SPECIFIC REQUEST FROM A DEVELOPER not to use qif now ends the debate? Phil Sandifer 20:32, 18 December 2005 (UTC)
- Specifically, from Wikimedia's DBA - David Gerard 20:36, 18 December 2005 (UTC)
So do we simply stop cleaning up?
So I was going to try to replace stuff like {{if defined call3}} with {{qif}}: should I simply not bother? Does the transclusion system cache templates? So if a given article uses five templates, all of which use {{qif}}, does the system fetch {{qif}} five times, or just the once? If the answer is "yes, it caches them", and if those five templates currently use various different things all of which are more complicated, like {{if}} or {{if defined call3}}, would it not be better to consolidate them so that they all use {{qif}}, which is apparently the most efficient and server-friendly of all the options at present? Yours puzzled and feeling slightly battered —Phil | Talk 09:27, 19 December 2005 (UTC)
- To my best knowledge, templates are cached, but if a template is used five times with different parameters each time, then it counts as five different templates as far as the server is concerned - hence requiring five fetches. What you've been doing is an improvement, but a further improvement would be not using QIF either. In general there's no need for any template to call any other template. Radiant_>|< 10:08, 19 December 2005 (UTC)
Feature request
- Experimental technical prefetch — Some high traffic template could be stored in a high-speed buffer to be used as is. →AzaToth 02:26, 17 December 2005 (UTC)
- (moved to talk page since this isn't an existing alternative to meta-templates, but a feature request. Submitting it to BugZilla may be useful). Radiant_>|< 21:41, 18 December 2005 (UTC)
Protected
Owing to foolish removal of the policy tag on querulous and insubstantial grounds, I have protected the page. And don't say I didn't warn you - David Gerard 21:02, 18 December 2005 (UTC)
- Seconded. Any issues related to copyright, legality or server load can be and are imposed by Jimbo, the Board or the Devs. I would like to hear a good reason for not deprecating all "conditional" templates, because their practical use is outweighed by the problems they cause. Radiant_>|< 21:37, 18 December 2005 (UTC)
- Speaking of policies: "Admins must not protect pages they are engaged in editing, except in the case of simple vandalism." —Lifeisunfair 22:07, 18 December 2005 (UTC)
- Removing a policy tag counts, thank you for playing! - David Gerard 22:16, 18 December 2005 (UTC)
- By definition, edits made in good faith are not vandalism. Removing a policy tag from an undisputed policy page (in an attempt to stir trouble) would be vandalism, but removing a policy tag from a page that one genuinely believes does not contain a policy is not an act of vandalism; it's a content dispute. You were indirectly involved in an edit war, and you ended it by protecting the page in your preferred state. —Lifeisunfair 22:47, 18 December 2005 (UTC)
- Removing that policy tag shows a lack of understanding of what Misplaced Pages policy actually is and how it works. Repeatedly removing it after being told not to by people more knowledgeable on the matter is, to put it mildly, misguided. This is not a content dispute, it is important to system integrity. Radiant_>|< 00:28, 19 December 2005 (UTC)
- I agree that the removal of the policy tag was misguided, but it was not vandalism (simple or otherwise). There are plenty of revert wars in which one side is flagrantly wrong, but that doesn't mean that their edits are made in bad faith. I understand why David protected the page, but I believe that this decision was hasty and premature. Rather than taking the time to solve the problem (by politely explaining why the policy tag was applicable), he took the shortcut of blocking all non-sysop edits (including legitimate ones), and threw in a mention of how "foolish" his opponents were. —Lifeisunfair 00:51, 19 December 2005 (UTC)
- Removing that policy tag shows a lack of understanding of what Misplaced Pages policy actually is and how it works. Repeatedly removing it after being told not to by people more knowledgeable on the matter is, to put it mildly, misguided. This is not a content dispute, it is important to system integrity. Radiant_>|< 00:28, 19 December 2005 (UTC)
- By definition, edits made in good faith are not vandalism. Removing a policy tag from an undisputed policy page (in an attempt to stir trouble) would be vandalism, but removing a policy tag from a page that one genuinely believes does not contain a policy is not an act of vandalism; it's a content dispute. You were indirectly involved in an edit war, and you ended it by protecting the page in your preferred state. —Lifeisunfair 22:47, 18 December 2005 (UTC)
- Removing a policy tag counts, thank you for playing! - David Gerard 22:16, 18 December 2005 (UTC)
- Where exactly was this adopted as policy? Where was the community consenus obtained, or the decreee from jimbo posted? (Jimbo is as far as I know the only person entitled to make policy without gaining an explicit consensus.) In fact I don't see any basis for having even the {{guideline}} tag on this page, but that is far mor arguable than the policy tag. Unless someon can post a link to the place where consensus was obtained, or to a clear statement from jimbo makign this policy, i think the policy tag should be removed, and I will probably do so after a delay for evidence of adoption to be provided. DES 22:07, 19 December 2005 (UTC)
- From Misplaced Pages:Policies and guidelines: "A select few important policies are not decided by community consensus, but imposed by Jimbo, the Board, or the Developers - in particular, anything related to copyright, legal issues, or server load." --bainer (talk) 22:15, 19 December 2005 (UTC)
- "A select few important policies are not decided by community consensus, but imposed by Jimbo, the Board, or the Developers - in particular, anything related to copyright, legal issues, or server load." --Misplaced Pages:Policies and guidelines. In this particular case, Jamesday, as head sysadmin, has repeatedly and explicitely stated that metatemplates have a large negative impact on the servers. Raul654 22:15, 19 December 2005 (UTC)
- Not that it's required, but Jimbo did endorse Jamesday's original statement. Correct? —Lifeisunfair 22:49, 19 December 2005 (UTC)
- I believe he did at some point, but cannot remember where I saw it (It could have been by email, on IRC, or on the wiki) Raul654 00:04, 20 December 2005 (UTC)
- Not that it's required, but Jimbo did endorse Jamesday's original statement. Correct? —Lifeisunfair 22:49, 19 December 2005 (UTC)
Unprotected
I've unprotected the page. This is not an invitation to remove the "policy" tag, or to alter the text in a manner that challenges the developers' authority. Any such act will be considered vandalism. —David Levy 07:20, 28 December 2005 (UTC)
- I find it disheartening that one of your first acts as an admin was to remove a protection tag in a dispute that you were involved in, and that formed the basis of most opposition to your RFA. Phil Sandifer 07:23, 28 December 2005 (UTC)
- 1. I wasn't involved in the dispute that led to the protection. (I support the inclusion of the "policy" tag, and never attempted to remove it.)
- 2. David Gerard was involved in the dispute, so he shouldn't have protected the page in the first place. Why haven't you complained about that?
- 3. After over nine days, the page remained protected (while admins continued to edit it). Was this supposed to be permanent?
- 4. Precisely one person (you) opposed my adminship on the basis of my comments on the issue of meta-templates. In doing so, you made a claim that was flagrantly false (that I "was one of the most active supporters of ignoring the devs on the meta-templates issue"). I assume that this was unintentional, but I don't understand why you ignored my polite requests that you amend the statement . —David Levy 07:42, 28 December 2005 (UTC)
- It does not matter whether that page is protected or not. Edits are not accepted there anyway (see this, which reverts Patrick without saying so). Actually, it would even better represent the actual situation if that page were protected. Please note: I do not intend to edit that page and I do not endorse ignoring the developers. Adrian Buehlmann 08:28, 28 December 2005 (UTC)
Potential alternative to meta-templates
AzaToth has written m:User:AzaToth/Logic, which implements conditionals as Mediawiki builtins; I've brought this code to the attention of wikitech-l and also suggested he speak to Brion, Tim and/or Jamesday on #wikimedia-tech - David Gerard 21:50, 18 December 2005 (UTC)
- Sounds like an improvement since it doesn't require a db query, but wouldn't it be possible to make such calculations clientside rather than serverside? Radiant_>|< 21:57, 18 December 2005 (UTC)
- Yes it would be possible by defining classes and using javascript, but it have some problems, one is that redundant information will be transmitted and increase the bandwidth (dont know how much this will affect on the total), and two if using javascript, all templates will be evaluated even if they are not to be shown (My implementation is ment to be run before any other parsing of the wiki code is performed), third is that if using javascript, it's problematic to access parameters (you could include all paramters, but how would you then decide what paramter belongs to what part of the document) →AzaToth 22:15, 18 December 2005 (UTC)
- If AzaToth's method (or some variation) proves feasible, it should satisfy everyone. This is precisely the sort of solution that I've been hoping for (since before I even knew that meta-templates existed, let alone learned of their negative impact). I strongly believe that we should wait to see how this pans out before engaging in the nightmarish process of eliminating all existing implementations of conditional templates. —Lifeisunfair 22:07, 18 December 2005 (UTC)
- In terms of convenience, server load issues entirely trump the need for meta-templates. If the devs say "stop doing this now" and there may be an alternative available later, then we should not continue doing this in the hope that the alternative may appear. Radiant_>|< 22:20, 18 December 2005 (UTC)
- I'm not attempting to downplay the importance of this issue, but some of these applications would be a huge pain in the neck to remove (without a suitable replacement for the meta-templates). This would require countless article edits, and would force users to alter the manner in which familiar templates are used. I see little harm in at least waiting until we've learned whether AzaToth's code could be implemented in the near future. In the meantime, let's concentrate on killing the flagrantly frivolous uses of meta-templates. —Lifeisunfair 22:47, 18 December 2005 (UTC)
- I realize that it would be a pain to remove certain things, and that certain editors may have to change their behavior with those templates. However, this problem is going to get worse the longer we wait. Given the fact that the Devs are extremely busy, it sounds unlikely that they will implement AzaToth's (excellent) suggestion any time soon. In general, unless you have explicit word from a Dev that they will implement a thing like this reasonably soon, it is safe to assume that they won't. Radiant_>|< 00:34, 19 December 2005 (UTC)
- I'm not attempting to downplay the importance of this issue, but some of these applications would be a huge pain in the neck to remove (without a suitable replacement for the meta-templates). This would require countless article edits, and would force users to alter the manner in which familiar templates are used. I see little harm in at least waiting until we've learned whether AzaToth's code could be implemented in the near future. In the meantime, let's concentrate on killing the flagrantly frivolous uses of meta-templates. —Lifeisunfair 22:47, 18 December 2005 (UTC)
- In terms of convenience, server load issues entirely trump the need for meta-templates. If the devs say "stop doing this now" and there may be an alternative available later, then we should not continue doing this in the hope that the alternative may appear. Radiant_>|< 22:20, 18 December 2005 (UTC)
My concerns
I take this issue very seriously. If the use of meta-templates is harming Misplaced Pages, something must be done to stop this.
I am, however, curious as to why the guideline wasn't elevated to the level of policy sooner, and why this was done only when a dispute regarding the guideline's validity began. I'm not arguing that the "policy" status is illegitimate, but I can understand why someone might suspect that this sudden change was made purely as a means of justifying controversial edits (the removal of meta-templates). Comments on the part of Jimbo have been referenced, and I would sincerely appreciate a link.
Additionally, it's highly irresponsible to deliberately break (and protect) a template, thereby forcing others to clean up the resultant mess "by dinner." When a reader is simply attempting to obtain information from the encyclopedia, a message asking him/her to "fix the page to exclude this template" is not helpful, especially considering the fact that the template in question usually doesn't even appear directly on the page (which is likely to confuse people in such a manner that they remove useful templates from articles, instead of removing the meta-templates contained therein). —Lifeisunfair 22:07, 18 December 2005 (UTC)
- To be clear, it wasn't a matter of "Clean up these templates before dinner or no dessert." I had faith - faith that appears to be well-founded - that the templates would get tidied in about six hours, and that this would be the most effective way to kick-start the process. Phil Sandifer 22:09, 18 December 2005 (UTC)
- I understood your logic, but I believe that this may have resulted in more harm than good. How many people responded to the request to "exclude this template" by removing the only templates that they saw in the articles that they were reading (when in actuality, the meta-templates were contained therein)? Is there even a way to check?
- At the very least, you should have selected less ambiguous wording. Ideally, you would have waited until the template was orphaned, instead of temporarily compromising the quality of however many articles were affected. —Lifeisunfair 22:47, 18 December 2005 (UTC)
- In fact, I think it was about ten minutes total - David Gerard 22:20, 18 December 2005 (UTC)
- Presumably, this was due to the fact that most applications of {{if}} already had been replaced with {{qif}}. I implore everyone involved to please not take this sort of approach with the latter template. —Lifeisunfair 22:47, 18 December 2005 (UTC)
- Here's the issue in a nutshell. It was marked guideline, in the sense that metatemplates were/are not absolutely 100% forbidden. They should be avoided whenever possible, unless you have a really, really good reason not to. Unfortunately, this distinction was (a) too subtle, and (b) more-or-less ignored by people who went about creating the abominations we have today. Obviously the subtle approach has failed, misreably. As such, I've marked it as policy, which it was all along. Raul654 22:10, 18 December 2005 (UTC)
- And don't forget the attempts to run a vote on computer science and database and cache performance. Certainly my first exposure to faith-based computer science on this level ... outside a commercial context - David Gerard 22:20, 18 December 2005 (UTC)
- I'm sure that if he were to hear it, Scott Adams would make a lovely strip out of that. You know, I think gravity is very inconvenient this month. Let's vote on reducing it. Radiant_>|< 22:23, 18 December 2005 (UTC)
- Indeedy. RFC that Newton guy, we had 68% against. And as for climate change ... - David Gerard 22:32, 18 December 2005 (UTC)
- I'm reminded of an article from the Onion. —Lifeisunfair 22:58, 18 December 2005 (UTC)
- If you think people are trying to vote away technical problems, you aren't paying attention. — Omegatron 23:08, 18 December 2005 (UTC)
- Those people who claim that WP:AUM is not policy are unaware of the nature of Misplaced Pages policy. Technical and legal issues trump consensus. Radiant_>|< 00:42, 19 December 2005 (UTC)
- From Misplaced Pages:Policies and guidelines: "A select few important policies are not decided by community consensus, but imposed by Jimbo, the Board, or the Developers - in particular, anything related to copyright, legal issues, or server load." --bainer (talk) 01:12, 19 December 2005 (UTC)
Take a step back and analyze the situation.
Much of this acrimony is simply finger-pointing (on ALL sides) about technical problems. No, they can't be voted away. But they can and should be fixed. There are two underlying problems here that I see:
- MediaWiki doesn't have native support for conditionals and Boolean operations, so templates must be used to obtain such functionality, which is inefficient of server resources.
- MediaWiki has a broken transclusion feature that causes nested templates to use far more server resources than they should.
Expecting users to forever constrain their functionality for the sake of software limitations is foolish and fundamentally un-wiki. The underlying bugs have to be fixed; there is no other alternative. Conditional and Boolean operations must be added to the engine so that they don't have to be invoked through templates, and the transclusion code must be altered so that it doesn't choke on nested templates. I think we have a right to ask why the developers haven't fixed the issue yet, despite complaining when a permanent fix will be implemented, given that we have known about the resulting problems for nearly a year. No doubt it's easier to ask users to alter their behavior than to fix the software's shortcomings, but it's also lazy and stupid not a viable long-term solution. Firebug 00:30, 19 December 2005 (UTC)
- Regarding finger-pointing, you have just called the Devs "lazy and stupid" for asking Misplaced Pages users to not abuse a certain feature. Please don't do that. You have every right to ask the Devs anything; I'd estimate that their answer to this particular issue would be that it's a good idea, but that they have other priorities. If they ask that we not abuse this feature until and unless it is fixed, that is entirely within reason. It would also be entirely within reason if they were to disable it entirely for the time being. Radiant_>|< 00:39, 19 December 2005 (UTC)
- You're right, my original comment was intemperate. Mea culpa. See revised version above. If the developers think that there are more important issues to fix, I would be interested in knowing what those issues are. If nested templates are such a server problem (and apparently the if template locked the database today) then it would seem like it should be a high priority issue. Furthermore, the amount of bile being generated over this issue (and I admit I am not entirely innocent here) is harmful and poisonous to Misplaced Pages. This whole issue is an open sore, and it needs to be healed. And the only way to permanently do that is to fix the underlying technical issues - not to tell users to change their behavior in ways that are inconvenient and distract from our goal of encyclopedia-building. Firebug 00:46, 19 December 2005 (UTC)
- We had no problems conveniently building the encyclopedia before the logical templates existed (which has only been for a couple of months, after all). IIRC, the Devs are busy with the fact that Misplaced Pages traffic has roughly doubled since September. It would be great if they could implement a better system for WikiProgramming, and that is indeed the ideal solution. But it would require thought, implementation and testing - so in the meantime we should pay them heed. Radiant_>|< 00:52, 19 December 2005 (UTC)
- You're right, my original comment was intemperate. Mea culpa. See revised version above. If the developers think that there are more important issues to fix, I would be interested in knowing what those issues are. If nested templates are such a server problem (and apparently the if template locked the database today) then it would seem like it should be a high priority issue. Furthermore, the amount of bile being generated over this issue (and I admit I am not entirely innocent here) is harmful and poisonous to Misplaced Pages. This whole issue is an open sore, and it needs to be healed. And the only way to permanently do that is to fix the underlying technical issues - not to tell users to change their behavior in ways that are inconvenient and distract from our goal of encyclopedia-building. Firebug 00:46, 19 December 2005 (UTC)
- It is a perfectly viable long term solution. In the worst case, it means we have fewer pretty boxes. We can live. Phil Sandifer 00:55, 19 December 2005 (UTC)
High-risk templates
There is currently a proposal to protect all high-risk templates, this may include meta-templates. See Misplaced Pages:High-risk templates. --bainer (talk) 23:24, 18 December 2005 (UTC)
Let's get this straight
Facts
- Templates are harmful
- Templates (and categories) incur much more server load than other operations like editing.
- The only quantifiable description of the damage I have ever read is that category views take 1000+ times as many resources as regular page views.
- Especially templates that are used on many pages.
- Especially templates that are used within other templates (here called "meta-templates").
- Especially when they are edited.
- Using fewer templates on fewer pages, especially templates within templates, would alleviate the server load problems.
- Templates are helpful
- Templates help keep references thorough and content consistent.
- Examples: {{Book reference}}, {{FishBase species}}
- Templates make article wikitext simpler and more accessible to non-technical editors, by hiding complicated markup.
- Templates and "meta-templates" make maintenance much more efficient, from a human standpoint.
- If the same text needs to be updated on many pages, it is quicker to edit a single template than to edit all of those pages by hand (the "busywork" referred to on this talk page). This frees up editors to contribute content instead of being janitors.
- Templates and "meta-templates" are convenient, easy to remember, and prevent mistakes (like malformed HTML that works on the editor's browser, but not everywhere)
- Examples: {{tl}}, {{edit}}, {{prettytable}}
- Templates and categories aren't an inherently bad feature; they're just implemented inefficiently
- This can be fixed in the future, allowing us to use templates as convenient, but it won't be happening any time soon.
- This page, as currently written, can be interpreted in many different ways
- "Avoid" is a vague word, interpreted by some to mean "all templates and the users who create them are to be shot on sight", and interpreted by others to mean "don't use them for trivial things like userboxes, but they're ok where they help with encyclopedia content".
- The term "meta-templates" is now being used to refer to regular templates, templates that only have simple HTML and visual formatting in them, templates within templates, and so on.
Opinions
- Subst'ing commonly-used templates is more beneficial to Misplaced Pages than transcluding them.
- "Meta-templates" should be "avoided". (Whatever that means...)
- Features that are currently implemented with templates would be better implemented directly in the software
- Templates that only contain simple HTML should be deprecated and deleted.
- Templates are only used because editors are lazy and don't understand anything about servers.
- ...
No one is disputing that they cause technical problems or trying to make the problems go away by consensus. We're disputing opinions about how much we need to limit useful functionality to alleviate those problems. The developers just say "avoid unnecessary server load". But what does that mean? Clearly, no one agrees.
This page needs to be more explicit about what is acceptable before it becomes guideline or policy. Then it will be taken seriously and won't be susceptible to abuse and misrepresentation. — Omegatron 02:24, 19 December 2005 (UTC)
- The lead DBA has flatly said DON'T USE THEM UNLESS WE HAVE TO. What the hell is hard to understand about this? Phil Sandifer 02:40, 19 December 2005 (UTC)
- in german we have a saying: the only thing you have to is to die one day. Tobias Conradi (Talk) 15:05, 4 January 2006 (UTC)
- Yes, that's what I just said. — Omegatron 02:56, 19 December 2005 (UTC)
- I am finding it very hard to believe that you genuinely find this hard to understand. Phil Sandifer 03:26, 19 December 2005 (UTC)
- I can definitely see both sides of this, and I suspect the problem is the interpretation of unless we have to. Since anything that can be done with a template (any template) can be done in straight wiki-code, in a strict since "unless we have to" means never. I genuinely don't think it's necessary to never use templates. Similarly, I genuinely don't think it's necessary to never use meta-templates. Like most issues, I suspect this one is not simply black or white. A meta-template used by 4 other templates which are in turn used on a total of 10 articles is not a problem. A meta-template used by 100 templates which are in turn each used by 100 other templates used on a total of 50,000 articles is a problem. The question from the "I'd like to use these things, they're damn convenient" side is where is the line? From the other side, I think the recommendation is to start with an assumption that "never" would be good, and anything more than that should have a VERY good justification - always try to find a reasonable alternative. This says don't do the meta-template used by 4 other templates that way - just duplicate the code. Sure, it's probably not a problem, but for something used that little who cares? However, how about {{U.S.A. State Congressional Delegation}} (50 derived templates, total of 535 articles including it)? Is there some rule of thumb we could develop as a guideline, perhaps with more variables than number of templates and total articles (like frequency of changes to the articles)? Should we inline (subst) infoboxes? Are there high runner templates we can work on getting rid of (or duplicating in code)? People want ways to increase consistency between articles (it adds to the professional look) and to avoid duplicating wikicode. Just a guess, but I suspect many contributors are programmers and used to using macro languages. Having one here, but being discouraged from using it (the more widely used, the worse it becomes) seems kind of perverse. Hard rules would help. Avoid if possible (when it's always possible to avoid) just isn't that clear. -- Rick Block (talk) 04:39, 19 December 2005 (UTC)
- I would conclude from that "Avoid in all cases, but if someone comes by and manages to make a persuasive case that they have found an essential meta-template, go ahead and accept that." Phil Sandifer 04:41, 19 December 2005 (UTC)
Examples
- Specific example: {{succession box}}. Using this template makes any article using it use 7 templates. Any change to any such article requires at least 8 database fetches (one to fetch the article contents, 7 more to fetch the contents of the templates). From a DB perspective, using this template makes the article 8 times more expensive to regenerate (than if no templates were used at all). I got tired of counting references at 10,000. I'd venture a guess that most of the references could be replaced with a similar version defined in a single template reducing the DB cost of regenerating these articles by a factor of 4. We could create a family of such templates. Should we? -- Rick Block (talk) 05:19, 19 December 2005 (UTC)
- Succession boxes are entirely too overthought. One could do the same function with a single template - no meta-templates, no sub-templates. -- Netoholic @ 06:17, 19 December 2005 (UTC)
- Exactly. That would also make the templates easier to use; if a newbie wants to write a sucbox, he has to read through several pages of manual to figure out how it works, so it's hardly more convenient to all - and to a non-editor, the end result looks the same both ways. But it would actually be easiest if the developers simply disabled templates-in-templates for the time being. Radiant_>|< 10:27, 19 December 2005 (UTC)
- Are you suggesting that the developers should simply break Misplaced Pages:Babel (as a prominent example), along with everything else that uses this feature? —Lifeisunfair 10:55, 19 December 2005 (UTC)
- If 'Succession box' can be redone as a single template... please do so. Or give me some pointers on how to replace the QIFs in s-ttl and I'll do it. I can see a way to just have the descriptive text there passed in as a parameter, but since no such parameter exists in the current calls any which use it would have to be rewritten. Is there another way to handle it? It'd be nice to stop kvetching about the problem and start fixing it. I'd identified 'Succession box' as a fairly small item which has QIF calls and gets used extensively (there are even templates which call 'Succession box' like 'template:Pope')... a logical candidate for fixing. However, when I started looking around for pointers on HOW to fix it all I found was this monstrous argument. Maybe we could identify the most heavily used simple nested templates and find ways to clean those up. Logically it isn't the templates that make two internal calls and get used on five pages which are causing server load problems. Fixing the five biggest resource hog templates is likely to do more good than doing fifty at random. --CBD ☎ 13:47, 20 December 2005 (UTC)
- WP:HRT has a list of the most used meta-templates and the most used templates overall. --bainer (talk) 13:54, 20 December 2005 (UTC)
- Thanks! That's perfect. So let's talk about some of these:
- WP:HRT has a list of the most used meta-templates and the most used templates overall. --bainer (talk) 13:54, 20 December 2005 (UTC)
- Succession boxes are entirely too overthought. One could do the same function with a single template - no meta-templates, no sub-templates. -- Netoholic @ 06:17, 19 December 2005 (UTC)
- Ed - This template seems harmless enough on its own, but it gets called by every other template under the Sun to add those little 'edit' links in the upper righthand corner of the template box. Is there any reason it can't be bot replaced with something like '<span style="float:right;">''''</span >'? I used that to do the same task at Portal:Middle-earth (not to avoid server load... I didn't know about this problem... or the 'ed' template... we won't talk about my user page). This template is generally only 'two levels' deep... does 'depth' of meta templating have a more significant impact than frequency of doing so?
- As I understand it, the relevant factors are how many articles ultimately include the template regardless of depth (this affects how much cache invalidation has to happen when the template is changed) and how many templates must be fetched when regenerating an article when the article is changed (depth is related to this, but not the only factor). IMO Ed should be subst'ed where its used. Note that leaving a comment on what was subst'd might be useful. -- Rick Block (talk) 17:05, 20 December 2005 (UTC)
- Edit, Ed2, Ed right, Ed div - Minor variations on the above. Again, any reason not to bot replace them? Shouldn't impact 'Joe User' either way... the source template still comes out the same way. These seem to have no purpose except making it quicker for template builders to set things up.
- Yup, seems like bot-replace is in order. -- Rick Block (talk) 17:05, 20 December 2005 (UTC)
- Country - Simple template which gets called by every country specific template. Again, seems to make it easier for template BUILDERS rather than template USERS. Any reason not to bot replace all calls to this one with the equivalent logic in the calling template?
- Agree, more bot-replacing. -- Rick Block (talk) 17:05, 20 December 2005 (UTC)
- Test & Welcome - These aren't Meta, but they are everywhere. Do single level transclusions significantly drain server resources? If so, running a bot to convert these into 'subst:' would have a big impact.
- IMO welcome should always be subst'd, however I wouldn't expect pages including these to be regenerated often enough to be a significant resource issue. -- Rick Block (talk) 17:05, 20 December 2005 (UTC)
- Taxobox (group) - These have a separate template for each portion of the box, which (theoretically) is to be used on the page of every type/class of living creature. Are multiple template calls in one article better or worse than a single call which then calls each of the sub levels? Couldn't this be converted into a single call WITHOUT sublevels? Could that be bot driven or would it need to be manually updated?
- Per above, I believe total templates per article is one issue. Taxobox is done the way it is because at the time there was no way to do conditional table entries. This exists now, and taxobox could (and should) be redone as a single template. -- Rick Block (talk) 17:05, 20 December 2005 (UTC)
- is total num of templates the issue, and thus calling {{{qif}}} 10 times is the same as calling it one time? By turning taxobox into one temp you will need lots of {{{qif}}} Tobias Conradi (Talk) 15:25, 4 January 2006 (UTC)
- Per above, I believe total templates per article is one issue. Taxobox is done the way it is because at the time there was no way to do conditional table entries. This exists now, and taxobox could (and should) be redone as a single template. -- Rick Block (talk) 17:05, 20 December 2005 (UTC)
- Et cetera... just those few cover the most heavily called 'shallow' templates. Are templates with greater nesting a bigger problem? If so we should look at whether they can be unnested (like 'Succession box' and related progeny). That one seems to be both deeply nested and extensively used, so fixing it should probably be a priority. --CBD ☎ 14:26, 20 December 2005 (UTC)
- Maybe we should create a template performance improvement project. -- Rick Block (talk) 17:05, 20 December 2005 (UTC)
- I would think that several of these already have an associated project (which would probably be in a better position to improve things without breaking too many articles). The Military history project is going to deprecate {{campaign}}, for instance; similarly, I would think the taxobox templates would be done by the Tree of Life project, and so forth. —Kirill Lokshin 17:19, 20 December 2005 (UTC)
(back to opinioins)
- Phil, perhaps you should get the DBA to comment here. The problem is that no one can verify what you said is true because there is no references to any DBA saying anything. →AzaToth 12:11, 19 December 2005 (UTC)
- Part of the problem is that some (though not all) of these conversations evidently occurred via IRC. The community should be privy to such statements, so they should be reiterated (not merely cited) at Misplaced Pages proper. Hearsay is insufficient. —Lifeisunfair 12:21, 19 December 2005 (UTC)
- You've already been told by the DBA himself on this very page. What more do you want? Ambi 12:38, 19 December 2005 (UTC)
- Jamesday's statements here have been rather vague, and I'd like to hear from some of the other developers. Also, I'm still waiting for someone to provide a link to Jimbo's comments. —Lifeisunfair 12:56, 19 December 2005 (UTC)
- You can't wikilawyer around database specifications. You've been told to avoid them. The developers have more important things to do than come here and convincing people of that fact. Ambi 14:03, 19 December 2005 (UTC)
- Excuse me, but I'm not attempting to "wikilawyer" around anything. I merely want to understand the nature and extent of the problem. I'm more than willing to abide by the developers' recommendations, but Jamesday's statements on this page are not particularly specific. "Using resources unnecessarily is not helpful," but how should we define "unnecessarily"? (Technically, all templates are unnecessary.) Should we merely "work at reducing the use of qif," or should we ban it entirely? —Lifeisunfair 14:27, 19 December 2005 (UTC)
- You can't wikilawyer around database specifications. You've been told to avoid them. The developers have more important things to do than come here and convincing people of that fact. Ambi 14:03, 19 December 2005 (UTC)
- Jamesday's statements here have been rather vague, and I'd like to hear from some of the other developers. Also, I'm still waiting for someone to provide a link to Jimbo's comments. —Lifeisunfair 12:56, 19 December 2005 (UTC)
- You've already been told by the DBA himself on this very page. What more do you want? Ambi 12:38, 19 December 2005 (UTC)
- Part of the problem is that some (though not all) of these conversations evidently occurred via IRC. The community should be privy to such statements, so they should be reiterated (not merely cited) at Misplaced Pages proper. Hearsay is insufficient. —Lifeisunfair 12:21, 19 December 2005 (UTC)
- Phil, perhaps you should get the DBA to comment here. The problem is that no one can verify what you said is true because there is no references to any DBA saying anything. →AzaToth 12:11, 19 December 2005 (UTC)
- I agree with Lifeisunfair - Netaholics bot has just destroyed hours of my work, and I am faced with hours more work repairing the damage. This had better be truly official policy with a consensus among developers, rather than one persons POV, or else I am going to start reverting these corruptions. The developers have NO MORE IMPORTANT THING TO DO than to make editing straightforward and user friendly, avoiding as much as possible mid-course policy changes or clarifications that ruin multiple pages which require hours to repair. PAR 15:58, 19 December 2005 (UTC)
- Jamesday is the leader of the DevTeam. It is not his POV that we yield to, but his technical expertise. This is not a midcourse policy change, either - just something that has been systematically ignored by many users, which needs cutting back. Radiant_>|< 16:20, 19 December 2005 (UTC)
- From the users' perspective, the page's sudden shift from "guideline" to "policy" is a change, even if it was intended to be a policy all along (in which case it should have been labeled as such).
- Jamesday is the leader of the DevTeam. It is not his POV that we yield to, but his technical expertise. This is not a midcourse policy change, either - just something that has been systematically ignored by many users, which needs cutting back. Radiant_>|< 16:20, 19 December 2005 (UTC)
- I agree with Lifeisunfair - Netaholics bot has just destroyed hours of my work, and I am faced with hours more work repairing the damage. This had better be truly official policy with a consensus among developers, rather than one persons POV, or else I am going to start reverting these corruptions. The developers have NO MORE IMPORTANT THING TO DO than to make editing straightforward and user friendly, avoiding as much as possible mid-course policy changes or clarifications that ruin multiple pages which require hours to repair. PAR 15:58, 19 December 2005 (UTC)
- And again, Jamesday's technical expertise is unchallenged (by me, at least), but his precise stance is unclear. Does he believe that merely reducing the use of conditional templates (and/or utilizing them only for certain applications) would be sufficient, or does he believe that it's important to eliminate them entirely? There appears to be an assumption that the latter interpretation is correct, but I've yet to see him explicitly issue such a statement.
- Regardless, the issue of how to resolve the present situation should be discussed. I'm of the opinion that the affected templates should be reconfigured in a manner that allows them to transition as smoothly as possible, not broken en masse as a means of lighting a fire under the editors. —Lifeisunfair 22:49, 19 December 2005 (UTC)
Summing up this "debate"
If this can be called a debate...
The devs have, point blank, said to use meta-templates less. This is clearly their intent, and this is the intent that will be enforced. Deliberately putting meta-templates into use when you are aware of this page is a bad thing - expect to make a lot of people very angry, including those with administrator powers. Putting meta-templates into use when you're not aware of this page is a slightly less bad thing, and will result in your being made aware of this page. No amount of trying to say that you want more developers to tell you to stop or that the developers didn't tell you to stop clearly enough changes this fact. The developers were perfectly clear, and it is, at this point, time to listen to them. And that's really all the discussion that is necessary on the matter. If you put a meta-template into practice after this point, as far as I'm concerned, you're committing grevious vandalism with an intent to DOS attack the Wiki, and I, at least, am going to respond accordingly. Phil Sandifer 23:42, 19 December 2005 (UTC)
- "The devs have, point blank, said to use meta-templates less" - In response, the community has said, point blank, to fix the damn bugs. It's utterly unjustifiable to optimize the time of a few developers by wasting the time of thousands of Misplaced Pages editors. Firebug 02:24, 20 December 2005 (UTC)
- You do realize these developers are volunteers, don't you? We're hardly in a position to demand anything from them. —Kirill Lokshin 02:34, 20 December 2005 (UTC)
- I was under the impression that at least the DB admins were paid employees of MediaWiki foundation. Was this incorrect? Has any consideration been given to hiring paid developers or admins? The fact that we have to take orders from developers if they're volunteers (as opposed to the giving the orders to them if they're paid) is a serious shortcoming. Firebug 02:36, 20 December 2005 (UTC)
- It's my impression (which could be partially wrong) that none of the technical staff are paid positions. The foundation has enough problems raising funds for hardware that I think paid developers are out of the picture for the near future.
- On another note, I don't think the devs are giving us orders per se. They're trying to keep the site running; if we ignore them and cause the servers to collapse and die, it's more of a problem for us (the users) than it is for the devs, obviously. —Kirill Lokshin 02:40, 20 December 2005 (UTC)
- Incidentally, our editors here are volunteers too, but no one seems to have a problem with giving us orders. Firebug 02:57, 20 December 2005 (UTC)
- The devs have, point blank, said to use meta-templates less.
- Yes, we know that they should be used less. HOW MUCH LESS? You, despite your administrative status, lack the authority to divine an appropriate cutoff point.
- Putting meta-templates into use when you're not aware of this page is a slightly less bad thing, and will result in your being made aware of this page.
- I added such functionality to several templates before Netoholic informed me of the page's existence. I actually feel guilty for having unknowingly contributed to the problem.
- No amount of trying to say that you want more developers to tell you to stop
- Perhaps I've been unclear. I don't intend to ever use such template syntax again, until a developer explicitly states that it's okay to do so. I want at least one of them to issue a statement of greater specificity, not because I hope to find some wiggle room, but purely in the interest of setting the record straight. If it truly is their belief that all conditional templates should be eliminated for the time being, I want this to be made known in unambiguous fashion (thereby erasing any doubts regarding the policy's legitimacy).
- or that the developers didn't tell you to stop clearly enough changes this fact.
- Frankly, the developers (and those privy to their wishes) didn't tell the community to stop clearly enough. This isn't a complaint on my part, but an explanation of why I (among others) made some regrettable edits. I truly wish that the conditional templates had been nipped in the bud, but they were permitted to linger and multiply for months (during which many of us were led to believe that their use was entirely acceptable). Why wasn't something done about this sooner? As far as I can tell, Netoholic was the first person to speak up.
- The developers were perfectly clear
- No, they weren't (at least, not that I'm aware of). But please understand that I want them to be. I'm not saying, "let's all continue to use these templates until we're told not to." I'm saying, "let's be told what not to do, and hopefully no one will try to do it."
- And that's really all the discussion that is necessary on the matter.
- That simply isn't true. Assuming that every single conditional template should be eliminated, members of the community are entitled to participate in this process. I sure as heck don't see any developer demands that we break all of them en masse (instead of phasing them out in a manner that preserves as much continuity for readers as possible). —Lifeisunfair 00:37, 20 December 2005 (UTC)
- I completely and strongly agree with every point made above by Lifeisunfair. Not generally, but specifically, I agree with each point. PAR 01:17, 20 December 2005 (UTC)
- And you'll note that qif has not been shot on sight - Netoholic is, to my knowledge, working his ass off to write up replacements for it. If was shot on sight, and turned out to be wholly non-harmful, aside from the database lock that editing it caused. Furthermore, I have noticed significantly less opposition to deprecating all uses of these templates since I shot if. So, really, mission accomplished. Phil Sandifer 01:32, 20 December 2005 (UTC)
- How many articles had legitimate templates (in need of editing) removed by users who followed the instruction to "please fix the page to exclude this template"? Unless I'm mistaken, there's absolutely no way to determine the answer to this question. —Lifeisunfair 01:46, 20 December 2005 (UTC)
Template:Cleanup
Earlier this month, Freakofnurture used conditional calls to merge {{cleanup-date}} into {{cleanup}}. I just reinstated the former, and I want to modify the latter to add all articles containing instances of {{cleanup}} accompanied by a date parameter to the nonexistent Category:Inappropriate cleanup template use (thereby enabling us to identify and replace such invocations with {{cleanup-date}}, after which we can safely revert {{cleanup}} to its previous state). The template is protected, so I need an admin to do this (unless someone has an alternative plan). Thanks! —Lifeisunfair 01:15, 20 December 2005 (UTC)
- I could be mistaken, but doesn't adding a category to a template require touching all of the articles that use it for the category to show up on the articles? —Kirill Lokshin 01:18, 20 December 2005 (UTC)
- There's no need to add a category. I will use the "What links here" listing for Template:Cleanup and the Pearle bot to find and fix all invocations to use Template:cleanup-date. -- Beland 03:20, 20 December 2005 (UTC)
- Done. -- Beland 10:15, 25 December 2005 (UTC)
- There's no need to add a category. I will use the "What links here" listing for Template:Cleanup and the Pearle bot to find and fix all invocations to use Template:cleanup-date. -- Beland 03:20, 20 December 2005 (UTC)
Conference reference
I'm not agree with the changes made to {{Conference reference}} to follow this guideline. As this guideline says, "Meta-templates that are not essential should be avoided", and the use of {{qif}} in this template and others like {{Book reference}}, {{Journal reference}},… are essential to have optional paramenters, and this isn't a decorative feature.
I'm agree that the server load must be minimized, but optional template parameters are very useful if not completely neccesary. The problem is not the existence of these "advanced" templates but that the MediaWiki doesn't support optional parameters. The software must be changed, I don't know what's the best technical solution, but I can can propose for example:
- to have a very special qif template that is directly handled by the MediaWiki (not really a entry in the database but implemented directly by the software to achieve that funcionality efficiently), or
- developing a new template syntax that allow optional parameters
However, until the software is changed, current edits cannot be disrupted by this guideline, i.e. {{Book reference}}, {{Web reference}}, {{Conference reference}}… shouldn't be forbided, and when the new MediaWiki is implemented change them to be more efficient. I'm sure you know about WP:POINT, ¿doesn't you? --surueña 12:35, 24 December 2005 (UTC)
- The use of meta-templates is "essential" to the inclusion of optional parameters, but that isn't the context in which the policy was written. (Otherwise, all such meta-templates would be "essential.") The policy refers to cases in which the ultimate application is essential.
- I realize that what constitutes "essential" is a matter of opinion, but it's better to err on the side of caution. Unless a large segment of the community depends upon a particular setup in its current form (rendering it very difficult to change), any embedded meta-templates probably should be removed. And unless there's one heck of a special reason, new applications should be avoided entirely (until the issue is resolved in the software). —David Levy 13:25, 24 December 2005 (UTC)
qif for fundriser
Just a note: qif was nominated for the fundriser :-). See here: . – Adrian | Talk 17:33, 24 December 2005 (UTC)
Counterpoint
For a counterpoint to this page, see Misplaced Pages:Meta-templates considered helpful. Firebug 01:57, 26 December 2005 (UTC)
- Oh god. You can't vote away technical limitations. Why is this so difficult to understand? —Kirill Lokshin 02:29, 26 December 2005 (UTC)
- Sigh. No one's saying to vote away technical limitations. We're saying the developers need to fix the underlying technical problems. There are no physical limits preventing meta-templates from working properly; it's all software bugs. Firebug 02:32, 26 December 2005 (UTC)
- Strictly speaking thsi isn't a technical limitation -- meta-tempales work. They impose a cost, in some cases a very high cost. How high that cost really is, is a factual question which the developers should be the last word on. Whether that cost is worth paying is not a technical question, but a policy question, to be decided by community consensus unless overruled by a high authority such as Jimbo or the Board. DES 02:33, 26 December 2005 (UTC)
- Um, no. It's a technical limitation in the software, which the developers have explicitely said not to use. That makes it policy, notwithstanding this transparent end-run attempt. Raul654 02:36, 26 December 2005 (UTC)
- Raul, can you point to where a dev said that? Dan100 (Talk) 10:08, 26 December 2005 (UTC)
- Maybe if the developers would spend more time fixing the software and less time bitching at us... Firebug 02:42, 26 December 2005 (UTC)
- They're volunteers, remember? —Kirill Lokshin 02:45, 26 December 2005 (UTC)
- Which is part of the problem. We need developers who will be subordinate to community consensus and we can't get that with volunteers. Open source is great for providing general use software, but you need paid consultants to customize it for your business. Consultants who you can order to do things. Firebug 02:47, 26 December 2005 (UTC)
- Brion is actually employed by the Foundation. Dan100 (Talk) 10:10, 26 December 2005 (UTC)
- Are you willing to pay for consultants, then?
- Somewhat less snidely, we don't necessarily want developers subordinate to community consensus—particularly if the community is made up largely of non-technical people. There has to be somebody with both the knowledge and the power to say "X is a bad idea and we're not doing it". —Kirill Lokshin 02:50, 26 December 2005 (UTC)
- The only reason this is a bad idea is because of software bugs. And when you have known software bugs that are inconveniencing your users, you fix them, not tell your users to inconvenience themselves to avoid running afoul of them. Firebug 03:16, 26 December 2005 (UTC)
- You're mixing up two different issues here, though:
- Cost of using meta-templates: this cannot be removed entirely, only decreased. Any non-plain-text markup operation in MediaWiki has associated performance costs; any improvements that the developers can make in software are still bounded by the ability of the servers to keep up. As you can see at the top of the page, the availability of hardware is not a problem we can expect to go away.
- Adding native support for conditionals to MediaWiki: this is somewhat more complicated than it seems. For instance, we don't want support for loops (inadvertently) added, no matter how much the community wants them—the security hole that would open up is far too significant. Trying to add a strictly limited set of functionality is somewhat challenging, and it's unreasonable to expect that the developers would be able to do so as soon as you ask them. —Kirill Lokshin 03:48, 26 December 2005 (UTC)
- You're mixing up two different issues here, though:
- The only reason this is a bad idea is because of software bugs. And when you have known software bugs that are inconveniencing your users, you fix them, not tell your users to inconvenience themselves to avoid running afoul of them. Firebug 03:16, 26 December 2005 (UTC)
- They're volunteers, remember? —Kirill Lokshin 02:45, 26 December 2005 (UTC)
- Maybe if the developers would spend more time fixing the software and less time bitching at us... Firebug 02:42, 26 December 2005 (UTC)
- Strictly speaking thsi isn't a technical limitation -- meta-tempales work. They impose a cost, in some cases a very high cost. How high that cost really is, is a factual question which the developers should be the last word on. Whether that cost is worth paying is not a technical question, but a policy question, to be decided by community consensus unless overruled by a high authority such as Jimbo or the Board. DES 02:33, 26 December 2005 (UTC)
- Sigh. No one's saying to vote away technical limitations. We're saying the developers need to fix the underlying technical problems. There are no physical limits preventing meta-templates from working properly; it's all software bugs. Firebug 02:32, 26 December 2005 (UTC)
- Hi Firebug. I deeply understand your point. But I would not do any edit that presses the developers to do something. We do not know what the priorities of the developers are as we are just editors. We must assume that they have bigger fires than our meta-templates. But I agree with Firebug that the template implementation has a design bug that should be fixed. But we should not press the developers to do this by increasing the pressure on the servers. We should now calm down and see what happens. In the mean time do not increase the pressure on the servers. Adrian Buehlmann 09:56, 26 December 2005 (UTC)
So anyone heard from an active dev on this?
Jamesday's original comments are eleven months old - since then, the processing power of the Wikimedia servers has grown several fold and there's been many software changes. James's latest comment is Using resources unnecesssarily is not helpful, which seems pretty vague to me (we don't seem to be short of cycles at the moment). It's certainly far short of saying "no, do not use these templates".
When this was raised on the mailing list by David, there was a resounding silence from the devs, despite the fact that these templates are live and in use. I'm pretty certain that if Brion, Tim or Domas (who know the current hardware/software the best) had concerns about these templates, they'd have told us.
Of course, the ideal would be to get a clear statement from one of those guys.... Dan100 (Talk) 10:06, 26 December 2005 (UTC)
- A quick example of software change (taken from the project page): Please read "The touching process involves a database update to every affected page". There are changes in 1.5 which will help. How much is currently not known. Jamesday 14:55, 6 August 2005 (UTC) - Dan100 (Talk) 10:18, 26 December 2005 (UTC)
- You're still trying to wikilawyer around an explicit statement. We've been told to avoid meta-templates - something that was restated by James all of eight days ago. You can lawyer your way around that word all you like, but that still doesn't change the effect on the servers. Ambi 10:36, 26 December 2005 (UTC)
- Just a note: Jamesday has made a newer statement. This one is quite explicit: . He wrote "Please instead work at reducing the use of qif to reduce the harm". Adrian Buehlmann 10:44, 26 December 2005 (UTC)
- I agree that Jameday has clearly stated that the use of
meta-conditional templates can result in server strain. He has not, however, indicated that they should be eliminated entirely (at least, not that I've seen). Perhaps they should be, in which case I would like to hear that from him (or another developer). I have absolutely no intention of using such templates, but I firmly believe that others are entitled to a first-hand confirmation of the interpretation that "reducing the use" = "banning all use." This is not "wikilawyering"; it's honest communication. —David Levy 12:13, 26 December 2005 (UTC)
- I agree that Jameday has clearly stated that the use of
- And no one is saying they should be banned entirely. As David Gerard has pointed out time and time again, they are enabled because they are vital for a very few things. People have then ignored this, and used it for just about any damned thing they please. Ambi 15:22, 26 December 2005 (UTC)
- Part of the confusion stems from the fact that the term "meta-templates" is being used to describe two different things. You're referring to the correct connotation (a template within a template), but the controversy relates primarily to "conditional templates" (templates with optional/variable parameters). I meant to use the latter term.
- I strongly agree that the function has been abused (often unwittingly), and I'd like to hear from Jamesday (or another developer) regarding the extent to which its application should be "reduced." I don't believe that anyone else possesses the authority to decide where to draw the line. —David Levy 17:21, 26 December 2005 (UTC)
- Could you give an example of a use of a meta-template that should not be banned? Adrian Buehlmann 17:01, 26 December 2005 (UTC)
- Mav uses a pile of them for fundraising templates and really wanted templates-in-templates to keep working for this - David Gerard 17:11, 26 December 2005 (UTC)
- That's exactly what happens in every field. Look, for example there are people that thought about how to streamline book and web references, something which I find essential to an encyclopedia. Book references is also the field I came from to here. In several such fields many wikipedian-hours were invested into improving their templates. Take for example masterpiece template:language. It is just very hard to remove such a template and throw that work away. I understand that this might be hard to understand for outsiders - I mean those that were not taking part in the creation process of any of these complicated templates. I also agree that the servers do not care about theses communities. But it is very hard for them to accept that their template hits the servers badly. That's why this whole matter is so delicate. If someone finds qif and he sees it solves his problem he just gets excited and says - that's exactly what I needed! I could swear this happend on the fundriser team. (Switching to rhetorical mode) Oh my! do we really have to shoot all these beautiful templates? Adrian Buehlmann 18:14, 26 December 2005 (UTC)
- As another example, Misplaced Pages:Babel depends upon the extensive use of meta-templates. (Of course, user pages generate less traffic than articles.) —David Levy 17:21, 26 December 2005 (UTC)
- Fund-raising is an essential part of keeping the site running. The Babel templates are not. If they cannot be done without meta-templates - And I see no reason why they can't be - they should be abandoned. Phil Sandifer 17:25, 26 December 2005 (UTC)
- In fact, I was surprised to learn that Misplaced Pages:Babel uses meta-templates. I'm sure that it could have been handled without them, but that ship has sailed; it simply isn't feasible to switch thousands of users from the current setup, nor is it realistic to expect the abandonment of one of the most popular projects on Misplaced Pages.
- If I'm not mistaken, I recall reading a comment (either by one of the developers, or by someone quoting one of the developers) indicating that the use of meta-templates within the user namespace has a relatively minor effect on the database. Presumably, this is why Misplaced Pages:Babel has been allowed to exist in its current form (which is extremely convenient). I am, however, in the process of deprecating a ridiculously complicated (and entirely unnecessary) conditional Babel template created by Azatoth. —David Levy 17:55, 26 December 2005 (UTC)
- It most certainly is feasible - if a bunch of people implement a system that is a server drain despite a policy saying not to, those people can and should expect to have to clean it up. It is perfectly easy to create manually (Or by bot, or even, frankly, by substing the existing meta-templates into new templates) a set of Babel templates of the form of Template:Babel-en1 and so on, and these should be created. An announced changeover should take place, and a week after that we should shoot the meta-template version. Phil Sandifer 18:10, 26 December 2005 (UTC)
- Firstly, as I just mentioned, I believe that the developers have indicated that the use of meta-templates within the user namespace is not a major server drain.
- Secondly, why you are accusing the Misplaced Pages:Babel creators of deliberately ignoring a "policy"? Aside from its relative obscurity, WP:AUM wasn't even made a guideline (let alone a policy) until June 14.
- Thirdly, it certainly would be possible to deploy a substitution bot, bit this would leave numerous users with indecipherable code.
- Fourthly, this is a perfect example of why we need the developers to tell us where to draw the line; you believe that Misplaced Pages:Babel isn't important enough to justify the use of meta-templates, but many others would disagree. —David Levy 18:53, 26 December 2005 (UTC)
- The Babel project doesn't need meta-templates. It can be done just as well with individual templates for each language and proficiency. Nor does there need to be a bot substitution - just an announced deprecation, asking everyone to please change their userpages as the Babel templates are to be deleted at a certain date, and pointing them towards the new system. The bot would be useful mostly for generating the individual templates. This is the major problem with meta-templates - they're created as elegant solutions to problems, and are in fact only elegant on the user-level, and infact manifestly unelegant in practice. Phil Sandifer 19:21, 26 December 2005 (UTC)
- But keep in mind that qif breaks when substed. Adrian Buehlmann 19:04, 26 December 2005 (UTC)
- I was referring strictly to the Misplaced Pages:Babel templates, most of which don't incorporate {{qif}}. —David Levy 19:11, 26 December 2005 (UTC)
- Please refrain from naming those works "ridiculous". It has proven to be unhelpful in communicating with the wikipedians. Adrian Buehlmann 18:14, 26 December 2005 (UTC)
- I agree. The proper term is "so brain-wrenchingly stupid as to cause spontaneous cerebral hemmoraging." Phil Sandifer 18:25, 26 December 2005 (UTC)
- Way to be a teamplayer! (You see, I learn from Neto :-) Adrian Buehlmann 18:48, 26 December 2005 (UTC)
Section "Alternatives": Problem with CSS
The section "Alternatives" of the project page lists under point 3 the use of CSS. Netoholic is doing this and was quite successful for optional fields of infoboxes. Sadly this technique does not work for special browsers which do not support CSS, one of which is the text based lynx. Maybe there are also problems with screen readers. This was brought up by Ævar Arnfjörð Bjarmason on Template talk:Taxobox#Eliminating meta-templates. The CSS trick can be seen for example in this diff. Ævar kindly posted an example user view of that trick as viewed on lynx at . Adrian Buehlmann 23:02, 26 December 2005 (UTC)
- How about adding an infobox primitive to the MediaWiki engine, similar to the inherent support for tables? This would solve the consistency problems while reducing server load and could include support for optional parameters that would work in all browsers. Firebug 00:20, 27 December 2005 (UTC)
A helluva lot of this website sucks when viewed using lynx. At least, if we keep working to avoid meta-templates, the website will continue to function. Misplaced Pages:Browsers is out-of-date, but lynx/links software makes up 0.03% of the browsers used here in Feb 2004. I'm OK with a few tables not looking amazing without CSS as long as the site works well for the rest of us. Perhaps the taxobox should be split up into 3-5 more specific usages (Infobox Bacteria, Infobox Animal, ...), such that the optional parameters are cut to a minimum on each occurence. -- Netoholic @ 00:24, 27 December 2005 (UTC)
- This kind of dismissive attitude is not at all helpful. Firebug 00:56, 27 December 2005 (UTC)
- This entire objection is not at all helpful. Phil Sandifer 00:59, 27 December 2005 (UTC)
- Look, it's one thing to say that as a temporary hack we should avoid using these levels of abstraction in cases where there is another equivalent alternative, and quite another to say that we should go around breaking widely used templates - especially when there is NO alternative that works on all browsers - and let someone else fix the resulting mess. Netoholic is running around Misplaced Pages with a hammer breaking things, and rather than being treated like the vandal he is, everyone is patting him on the head and saying "good boy", an attitude I find utterly incomprehensible. But, then, I thought that we were trying to write an encylopedia, not genuflect before the genius of the developers that must not be questioned. Obviously, I was mistaken. Firebug 01:07, 27 December 2005 (UTC)
- The templates should never have been made! You're mad at the person who's actually UNDOING damage, and giving a complete pass to the people who implemented meta-template and meta-template over a period of MONTHS after the developers asked for meta-templates not to be implemented! Phil Sandifer 01:29, 27 December 2005 (UTC)
- Please! To all involved Wikipedians: stop using the word "vandal". Netoholic is not a vandal. Neither anybody else I've seen here. Adrian Buehlmann 09:16, 27 December 2005 (UTC)
- Look, it's one thing to say that as a temporary hack we should avoid using these levels of abstraction in cases where there is another equivalent alternative, and quite another to say that we should go around breaking widely used templates - especially when there is NO alternative that works on all browsers - and let someone else fix the resulting mess. Netoholic is running around Misplaced Pages with a hammer breaking things, and rather than being treated like the vandal he is, everyone is patting him on the head and saying "good boy", an attitude I find utterly incomprehensible. But, then, I thought that we were trying to write an encylopedia, not genuflect before the genius of the developers that must not be questioned. Obviously, I was mistaken. Firebug 01:07, 27 December 2005 (UTC)
- This entire objection is not at all helpful. Phil Sandifer 00:59, 27 December 2005 (UTC)
I have a question about using the css-hack, does it increase the resulting bandwith a lot? →AzaToth 01:11, 27 December 2005 (UTC)
- There's no reason why it would, really. CSS will be used Misplaced Pages-wide regardless of whether hiddenStructure is used in any particular article. —Kirill Lokshin 01:14, 27 December 2005 (UTC)
- I was refering to that text that is not ment to be visible is transfered →AzaToth 01:15, 27 December 2005 (UTC)
- The text is pretty minimal, compared to the rest of the article. I doubt it makes a noticeable difference; but you'll have to ask a dev if you want anything more concrete than that ;-) —Kirill Lokshin 01:21, 27 December 2005 (UTC)
- The resultant html is stored in a very fast Squid cache server. Meta-templates cause extra calls and work for the database servers - a much slower and more "costly" segment of the system. -- Netoholic @ 02:42, 27 December 2005 (UTC)
- It was not that I was asking about. Perhaps a rephrase: Does reducing usage of meta-templates weight up the increased dataflow over the squids? →AzaToth 02:49, 27 December 2005 (UTC)
- Are we back to arguing that the devs weren't thinking when they said to reduce the usage of meta-templates? Phil Sandifer 02:56, 27 December 2005 (UTC)
- I was just asking, you don't need to be angry. →AzaToth 03:02, 27 December 2005 (UTC)
- Are we back to arguing that the devs weren't thinking when they said to reduce the usage of meta-templates? Phil Sandifer 02:56, 27 December 2005 (UTC)
- It was not that I was asking about. Perhaps a rephrase: Does reducing usage of meta-templates weight up the increased dataflow over the squids? →AzaToth 02:49, 27 December 2005 (UTC)
- I was refering to that text that is not ment to be visible is transfered →AzaToth 01:15, 27 December 2005 (UTC)
If (or should I write qif? :-) I have to choose between (A) "no conditional logic in templates" and (B) "0.03% of the browsers display taxoboxes or other wp stuff badly" I must say that the second evil is the lesser one at the moment. The reason why I brought this here is that I wanted to know whether we could go further with this CSS trick or not. I think we all agree that that trick is not the best solution for all times (which qif also isn't, though it works with lynx), but at least the CSS trick works for now without violating WP:AUM (please, no start-over about this - we've been there enough). And at least we have a good reason to break lynx and possibly screen readers. If developers find time to implement something in WikiMedia that they see fit to solve our pain in the arse dilemma, they can look here. If somebody decides that lynx or screenreaders are prime then they can read here that we either need conditionals in WikiMedia code or a license to use qif in order to do that (or a lot more will break). Adrian Buehlmann 09:00, 27 December 2005 (UTC)
- One side-benefit of my template conversions is that I am actually making them more friendly to screen readers. One of the biggest issues for accessibility related to tables has to do with using the the proper table cells. A sad lot of Infoboxs just use plain cells, but the wikitable format includes codes for specifying a caption and TH (table headers). People using screen readers can "skim" a page by having it read only the caption of a table. To get more information, they can then navigate the row/column headers, to find the information they want to know. When you fail to use those features, there is no useful way for them to navigate the tables. As I'm going through removing meta-templates, I spend a good deal of time doing this formatting, and I encourage those others who work on templates to make full use of the wikitable formatting. -- Netoholic @ 10:01, 27 December 2005 (UTC)
- Patrick has just added this to the project page. m:MediaWiki talk:Common.css contains "Unlike conditional templates, this works only for final display. The result (in the example either "abc" or "") cannot be used in expressions for template names, parameter names, parameter values, page names in links, etc.". This is really sad (however, thanks to Patrick). My hopes for template:book reference are sinking... :(. Adrian Buehlmann 14:49, 27 December 2005 (UTC)
Policy tag
While leaving the page tagged as an official policy, I have changed the wording of the notice. The boilerplate {{policy}} template says that the tagged policy has "wide acceptance among editors", and to discuss changes on the talk page to make sure they reflect consensus. In this case, we've been told that consensus is irrelevant, and all that matters is what Brion and Jamesday are saying. Thus, I have customized the policy tag to reflect the unorthodox manner in which this was passed. What's the point asking people to discuss consensus on Talk when it doesn't matter anyway? Firebug 13:06, 28 December 2005 (UTC)
- Hi Firebug. WP:POL states under Misplaced Pages:Policies and guidelines#How are policies decided? that "A select few important policies are not decided by community consensus, but imposed by Jimbo, the Board, or the Developers - in particular, anything related to copyright, legal issues, or server load". So here "Developers" and "Server load" applies. Though I find the wording of the message box on top of the project page acceptable as it now is. Adrian Buehlmann 14:57, 28 December 2005 (UTC)
use of qif style parameter kludges
What is the policy/consensus of using {{qif}} style parameter kludges for optional display of data if they are held within a single template? I ask because there is an infobox – {{UK-ROI TV channel infobox}} – that I have worked on that is in urgent need of a rewrite since the current de-meta-templated version has a number of broken features. – MrWeeble Talk Brit tv 13:25, 28 December 2005 (UTC)
- Lead data base developer Jamesday explicitly asked to "Please instead work at reducing the use of qif to reduce the harm" ( lower part). This here is a policy (confirmed by developer request). So we are not allowed to revert if anyone removes a qif from a template. Although, personally speaking, it would be nice to wait a bit tearing down all uses of qif, as one of the leads on this announced (See also User_talk:David_Gerard#What is the plan for Template:Qif?). Adrian Buehlmann 14:40, 28 December 2005 (UTC)
Thanks for this. I have actually read this entire page and posted this question because that does not actually answer my question. Obviously including qif as a subtemplate is depreciated, however is using the logic containted within it permissable if it is contained inline i.e. if it is effectively subst-ed rather than included as a template? – MrWeeble Talk Brit tv 15:00, 28 December 2005 (UTC)
- Sadly, qif breaks when substed. Adrian Buehlmann 15:08, 28 December 2005 (UTC)
Indeed, through trial and error I have discovered this to be so. However it is possible to hardcode using techniques similar to what qif uses, though avoiding using meta-templates. My question is, are these techniques permissible? (I know the code would looks awful and make it harder to debug/recode, but that is the inevitable drawback of removing meta-templates is that things can no longer be abstracted out). MrWeeble Talk Brit tv 16:27, 28 December 2005 (UTC)
- Doing so would result in terribly ugly template page source. Please be kind you your fellow, and future, editors. Let's take the discussion about this specific infobox to it's talk page. -- Netoholic @ 16:30, 28 December 2005 (UTC)
- I agree to discuss on it's talk page. Posted my reply there. Adrian Buehlmann 16:59, 28 December 2005 (UTC)
Elimination of Qif
How are we doing on the elimination of Qif? Phil Sandifer 20:42, 28 December 2005 (UTC)
- Given that the reference templates and the various succession-box templates still use it, I suspect we're not doing too well ;-) —Kirill Lokshin 20:56, 28 December 2005 (UTC)
- What links here lists 32'000+ articles. Adrian Buehlmann 13:02, 29 December 2005 (UTC)
qif without qif
Please have a look at what MrWeeble did at {{Infobox TV channel}} (talk). I mean this version. This technique does not violate WP:AUM. It's a manual substing of qif. Adrian Buehlmann 07:22, 29 December 2005 (UTC)
- It's vile and horrible, and should be canned forthwith…oh, good, someone did! If this is some interesting way of saying "give us {{qif}} or we'll fsck up a load of templates", I want no part of it. We should be working on ways to make wikicode more simple and easy to edit, not obfuscating it even more. As I commented elsewhere:
HTH HAND—Phil | Talk 08:24, 29 December 2005 (UTC)You know what's really odd? I find myself in complete agreement with Netoholic (cue dramatic music). The changes which included the dummy parameter stuff looked like a contestant in an obfuscated code contest: I was ready to cry at the mere thought that anyone could think this would ever be a sensible way to go.
- ok then. Was just a proposal. Not meant as an attack (strange that people constantly assume this). BTW the actual implementation of qif does exactly the same to the servers as the Weeble code does (minus the database access). Maybe we could have written a compiler for this, but anyway. I'll stop here. Good bye book reference. Adrian Buehlmann 08:47, 29 December 2005 (UTC)
- I am playing around with Template:Ship table, and I would like some guidance. Should I implement with "qif" and wait till a viable alternative emerges, should I implement (as far as possible) with the "class=hiddenStructure" thing and wait for a viable alternative? Please help me as best you can, to minimize the amount of writes and rewrites that will be necessary. Thanks for any help - PAR 16:21, 29 December 2005 (UTC)
- The developers have specifically asked for us to reduce the usage of qif - increasing its usage would thus be unfortunate. Phil Sandifer 16:31, 29 December 2005 (UTC)
- I am playing around with Template:Ship table, and I would like some guidance. Should I implement with "qif" and wait till a viable alternative emerges, should I implement (as far as possible) with the "class=hiddenStructure" thing and wait for a viable alternative? Please help me as best you can, to minimize the amount of writes and rewrites that will be necessary. Thanks for any help - PAR 16:21, 29 December 2005 (UTC)
- ok then. Was just a proposal. Not meant as an attack (strange that people constantly assume this). BTW the actual implementation of qif does exactly the same to the servers as the Weeble code does (minus the database access). Maybe we could have written a compiler for this, but anyway. I'll stop here. Good bye book reference. Adrian Buehlmann 08:47, 29 December 2005 (UTC)
- I've just upgraded the horror :-). For those interested: it can be basted at User_talk:Adrian_Buehlmann#Template:Infobox_TV_channel (instructions are given there). Please do not use that in articles. It is a canned technique. Just a lab study. Adrian Buehlmann 22:20, 2 January 2006 (UTC)
Comparison CSS trick/Weeble code
A comment just for the records (no intention to fight or vote):
(A) CSS-trick (Netoholic. Extracted from this revision):
|- class="hiddenStructure{{{closed date|}}}" ! Closed: | {{{closed date}}}
(B) Weeble-code (WikiMedia default params. Extracted from this revision. Added newlines for comparison):
{{{dummy parameter{{{closed date|}}} |<tr><th style="text-align:left">Closed Date:</th> <td>{{{closed date|}}}</td></tr>
}}}
Please compare yourself. The same trick, just different languages (CSS / MediaWiki syntax).Adrian Buehlmann 10:21, 31 December 2005 (UTC)
For comparing the same, the 2nd version should be:
{{{dummy parameter{{{closed date|}}} |<tr><th style="text-align:left">Closed:</th> <td>{{{closed date|}}}</td></tr>
}}}
Patrick 11:43, 31 December 2005 (UTC)
Wouldn't this do the same?
{{{if{{{closed date|}}}| ! Closed:}}}
| {{{closed date|}}}
--CBD ☎ 15:24, 3 January 2006 (UTC)
there'd be an error in your code I suspect, you have {{{ three times, but }}} four times. MrWeeble Talk Brit tv 16:25, 3 January 2006 (UTC)
- For anyone confused - I previously had an extra set of closing curly-braces at the bottom from a bad cut and paste. I'd fixed them before MrWeeble saved the above, but apparently after he'd seen them. --CBD ☎ 17:20, 3 January 2006 (UTC)
Sorry, dunno why we didn't it didn't show an edit conflict. I was seeing the dreaded error screen around that time - might be something to do with that. Anyway, the problem I see with that code, neat though it is, is that it will still add a row (though with no content to the cells) for each left out parameter. This would cause huge amounts of empty space on some templates. My version of the code has the table row definition within the optional content section. Unfortunately, because templates also use pipes, we can't use pipe based wiki tables, hence the HTML table elements. – MrWeeble Talk Brit tv 17:47, 3 January 2006 (UTC)
More unneeded server waste
Check out Template:tl and Template:tl2 ... will the madness never stop?!?!? ALKIVAR™ 00:38, 1 January 2006 (UTC)
- {{tl}} is used by many folks to make a "pretty" reference to a template (like the one here). It comes in at about #59 in the list of most referenced templates at WP:HRT with 4516 references. Some folks subst it now, but the subst'd version looks pretty ugly, especially considering template:tl (for example) is a nice ordinary looking link, both as displayed and in the markup. -- Rick Block (talk) 01:58, 1 January 2006 (UTC)
- Those aren't meta-templates. — Omegatron 05:34, 1 January 2006 (UTC)
- Any template called from within another template is a Meta-Template. ALKIVAR™ 12:15, 1 January 2006 (UTC)
- We're lucky then that it's not calling another template. —Locke Cole • t • c 12:23, 1 January 2006 (UTC)
- Any template called from within another template is a Meta-Template. ALKIVAR™ 12:15, 1 January 2006 (UTC)
- Although it's intent is not to be exclusively used from templates, it is used by a number of templates, e.g. Template:Afd, Template:AfD footer, Template:Merge, Template:Edit, Template:Move to Wiktionary, Template:Specialpageslist, Template:History of Australia, Template:Move to Wikibooks Cookbook, Template:AMA, Template:InPrint, ... -- Rick Block (talk) 17:00, 1 January 2006 (UTC)
- Ahh, that's another matter. Either we need to decide if the performance hit is worth it for some templates to call {{tl}}, or we need to subst in place, or find an alternative for those templates. But just using {{tl}} in articles/talk pages (which is what it was intended for) should be fine. —Locke Cole • t • c 17:12, 1 January 2006 (UTC)
- I've already been working on removing template:tl from templates. For example it was used in template:web reference so that made some 5000 articles dependent on template:tl. It was removed per my request. I was touching articles with my bot to update the used templates list but was stopped by Netoholic because he does not trust my bot. However: please note that if template:tl is only used inside the
<noinclude></noinclude>
section of a template, then articles transcluding that template do not depend on template:tl. I think this is the case for example with Template:Afd. Adrian Buehlmann 17:31, 1 January 2006 (UTC)
- Let's back up. Turning a template reference like template:tl into an invocation of a template by using {{tl}} anywhere (without subst'ing it) adds a database lookup to the cost of regenerating the page containing the reference. The only point to its use is to change the format of the reference from template:tl to {{tl}}, which sure seems to fall into the category of "unnecessary". If you subst it, it's exactly the same number of characters to type (so no advantage there), and if you subst it you leave a horrible looking mess in the raw page source. Perhaps the software should be changed to recognize links to templates and format them in some special way, but IMO using a template for formatting purposes is pretty close to just plain stupid. Maybe there's an argument that template:tl should exist for showing the syntax of template invocations, but I'd bet 99% of its references are folks using it to simply link to a template being discussed and find its appearance more pleasing than a vanilla wikilink. STOP IT! Just as we should avoid using metatemplates, we should avoid unnecessary use of any templates. Markup templates are particularly bad because they tend to become like jargon and their usage spreads uncontrollably among folks thinking they're demonstrating their expertise. Eschew performance sapping presentation frills! -- Rick Block (talk) 18:57, 1 January 2006 (UTC)
- Those aren't meta-templates. — Omegatron 05:34, 1 January 2006 (UTC)
- Yes! Phil Sandifer 15:09, 2 January 2006 (UTC)
- I must strongly disagree. Using {{tl}} has a cost, no doubt -- any template does. In my view it also has a significant benefit. Many tempaltes are used in effect for formatting. If this page is to be considered to require deprecating Tl, it ought to be renamed Misplaced Pages:Avoid using templates. DES 10:36, 2 January 2006 (UTC)
- Meta-templates in AfD pages are among the worst meta-template usage we could do - AfD is massively high traffic, and accounts for enough server strain as it is. We got by fine without this template for some time - the suggestion that this is somehow the end of the world is absurd. Phil Sandifer 15:09, 2 January 2006 (UTC)
- These can quite happily be substed. Claiming that the code is ugly is not a good reason not to spare the servers. ] 15:12, 2 January 2006 (UTC)
- To be clear, I'm suggesting using a plain old vanilla reference, like template:tl, rather than any template (subst'd or not). And, are you claiming {{]}} is not ugly? I'm a little surprised the parser doesn't barf on this. -- Rick Block (talk) 16:47, 2 January 2006 (UTC)
- I had a proposal before to change {{tl}}, but havn't got that in yet, the proposal is:
- To be clear, I'm suggesting using a plain old vanilla reference, like template:tl, rather than any template (subst'd or not). And, are you claiming {{]}} is not ugly? I'm a little surprised the parser doesn't barf on this. -- Rick Block (talk) 16:47, 2 January 2006 (UTC)
{{]}}
→AzaToth 17:12, 2 January 2006 (UTC)
Abomination?
Ok, I've come up with something that I haven't seen before and I'd like to get some opinions on its viability before it spreads. Take a look at the way Portal:Middle-earth/Featured article is transcluded into Portal:Middle-earth. Basically, it is set up to define a parameter named for the day of the week and then only print content if that parameter exists... causing the content printed to change each day. The same could be done for days of the month, months of the year, and other situations (possibly even a 'random' generation which changes each time the page is viewed). It currently uses a simplified version of 'WeebleCode', but doesn't need to... it can be implemented based entirely on exceedinly basic functionality of defaulting a parameter to blank - so long as every possible parameter name is set up. There is no 'meta-templating' involved, but would this kind of 'floating content' cause extra server drain? I can see this being copied into other portals (the ability to keep them 'fresh' without needing to constantly update them is incredibly valuable to the portal concept), user spaces, common templates ('this AfD will close in 3 days', '2 days', et cetera), and possibly even articles (ack!). If the 'random' concept is possible (I'm thinking I may be able to do something with the time or article count) and starts getting used to produce hundreds of random results... would this be a 'bad thing' <tm>? Basically, do we need to kill this now, set some sort of sane limits on it, or just let it go on without worries. --CBD ☎ 00:52, 3 January 2006 (UTC)
- (Comment, no vote) Just in case you haven't seen it: . See also User_talk:Adrian_Buehlmann#Template:Infobox_TV_channel. Obviously we both came up with the same idea (using parameter "if"). There must be something obvious on it :-) Adrian Buehlmann 08:57, 3 January 2006 (UTC)
- No, you came up with it. I just stole it from you. :] Makes the most sense. Especially when put at the top of the call - many people won't understand how it works, but it will be obvious that it is applying some sort of conditional logic to the other parameters. --CBD ☎ 12:36, 3 January 2006 (UTC)
- Ah, ok. The one that really came up with the heart of that solution is MrWeeble, kindly asking first on this talk here before doing it on Template:Infobox_TV_channel. I was the one who wrote to him that I do not see that this would violate WP:AUM which drove him to do that hard work, which then was rejected by Phil Boswell (and Netoholic). I've just added the newlines and used the param "if" afterwards. Adrian Buehlmann 14:38, 3 January 2006 (UTC)
- Netoholic wrote on my user talk:
- Please do not use this technique. The empty parameter requirement is enough to make this impractical. hiddenStructure really is a good strategy for the time being, and is only marginally bad for less than 0.03% of our visitors. The best idea would be to limit the optional parameters used on any one template to those most important to its function and those least likely to be blank. In other words, adding a new optional field which would only be used on a handful of articles is probably not the best option. -- Netoholic @ 22:42, 2 January 2006 (UTC)
- So he is against using that, at least for Template:Infobox_TV_channel I suppose. I do not know whether that applies to your Portal:Middle-earth case too. Phil Boswell was, well, frankly said shocked when he saw the wiki code (see above). His most recent statement was "should be canned fortwith". But he has not seen my "upgrade" with the added newlines on User:Adrian Buehlmann/work/Infobox TV channel/2006-01-02 yet. But I think there must be something with this default parameter which upsets people. I do not yet know why. What can be said from a technical standpoint is that it is calculated server side and as such makes more load on the servers. Jamesday also indicated that the parameter default might break in the future, so there is a risk in using this (see Template_talk:Qif). Otherwise I see not why it should not be used besides that it smaks like the not so beloved template:qif. Please do not assume that I am stonewalling against the removal of metatemplates. I just want that all parties know all available options and then decide based on the facts without emotions. I also absolutely do not want to pile a truckload of expressions onto the server just to press the developers to do something. If anybody thinks this, he is plain wrong. Adrian Buehlmann 14:43, 3 January 2006 (UTC)
- Well, as stated, the 'scheduled content' trick I came up with doesn't require an empty parameter... it is using one, but only because I didn't have all the days filled out at first and wanted to suppress undefined days. I could now remove the empty '|if=' with no loss in functionality, but left it in place for now in case others want to explore this concept. Even if the empty parameter were required I disagree that it is impractical... we've been running bots to completely rewrite template calls (or doing so manually). Adding an '|if=' to the top of each existing template call would be much simpler. The other issues you mention are more what I am curious about... this isn't a meta-template. Does that mean it is hunky-dory and should be used extensively or is it 'just as bad' for some reason. I'm looking for concrete reasons not to do this now so we don't have another 'You used a meta-templage! Sinner! Outcast! Unclean!' situation later. The possibility of parameter defaults 'breaking' is obviously a concern... but would destroy the CSS trick as well. I'm not sure about the 'calculated server side' issue. That's the kind of detail I'm looking for. Would a template that causes different text to be displayed each day (or each pageview if I can make a 'random number generator' - which is proving tricky) via this method cause significantly/slightly/any more load than a template which displays the same text on each pageview? If parsing empty default parameters slows things down then it would, otherwise I'd think it shouldn't... but I haven't studied the page building documentation. --CBD ☎ 15:02, 3 January 2006 (UTC)
Accessiblty concerns with css class hiddenStructure
User:Netoholic is advocating that lines in tables be hidden with class="hiddenstructure{{parameter|}}", rather than using more complicated parameter hacks. I wish to raise a number of concerns I have over the accessibilty of this technique.
Firstly, and most easily fixed, this uses visual styles only. The style rule speak:none should be added as well display:none so that it remains "hidden" for screen readers.
The second is this does not work for users on non-css browsers or for users who have CSS enabled. I know some do not feel that it is worth taking these users into consderation, but noting the accessibily features coded into wikipedia (if you turn off style sheets you get headings over the various navigation menus, such as "Views" and "Personal Options") I know that I am not the only one who thinks that they should in some way be catered to.
The third is similar to the second in that it fails when the stylesheet is not present, for instance on mirrors. http://www.1bx.com/en/ARY_Digital.htm is a mirror of ARY Digital, a page that uses the hiddenStructure css hack and the "hidden structure" is clearly visible as that site does not use our stylesheets. I am concerned that reliance on such a style rule is tantamount to being a self-reference (unless there is instructions linked off http://download.wikimedia.org/ or somewhere to indicate that it is necesary to use these stylesheets) – MrWeeble Talk Brit tv 14:06, 3 January 2006 (UTC)
- For what it's worth, this concerns me as well, but it seems to be getting lost in the "Great Meta Template Purge of 2005/2006". I know Ævar had concerns about Lynx users and screen readers as well, which he expressed here. A screenshot (also provided by him) pretty well showed how horrible the CSS hack was: . —Locke Cole • t • c 14:18, 3 January 2006 (UTC)
- Content control is not what CSS is designed for: the hiding of document content is more than a 'style' issue. We cannot expect mirrors of Misplaced Pages content to adopt Misplaced Pages style sheets: the content should remain independent of style. The CSS kludge could be reworked into inline CSS, but that would look really horrible. I tink it's fair to say that we do not yet possess a viable alternative to 'meta-templates'. --Gareth Hughes 14:33, 3 January 2006 (UTC)
- I think we do have a viable alternative. 'WeebleCode'. Yes, it requires an '|if=' statement or other blank parameter to be added to the template call. I don't consider that a big deal compared to the complete rewrite of many template calls which is going on. And, as per the example I just added to #Comparison CSS trick/Weeble code above, I think it is at least as simple to write this in templates as the CSS hiddenStructure trick. --CBD ☎ 16:14, 3 January 2006 (UTC)
Not sure it could be done inline except as style="display:none{{parameter|}};speak:none{{parameter|}}". unfortunately, setting a style property to a non-existant value results in invalid CSS, whereas calling an non-exisiting class is not invalid. – MrWeeble Talk Brit tv 14:44, 3 January 2006 (UTC)
- That's a very good point about using the CSS trick inline: it creates invalid CSS. Your code is good. but has the draw back of requiring the dummy parameter to be defined in every calling article, and of not allowing table pipe syntax. I'm not so sure that this is such a viable alternative. --Gareth Hughes 18:45, 3 January 2006 (UTC)
Indeed, I am not specifically advocating the dummy parameter hack over any other option, there seems to be real disadvantages with them all. Just hoping that we can either find a decent alternative (preferable) or at least reach a consensus as to which evil is the lesser. I suppose it comes down to which is deemed more important by the community, accessibilty of output or usability of input. – MrWeeble Talk Brit tv 20:00, 3 January 2006 (UTC)
- For the very high use templates we'll need a bot to add the dummy parameter to all the template calls. This would make this hack a little less 'evil'! --Gareth Hughes 23:23, 3 January 2006 (UTC)
- I did a complete conversion of {{taxobox}} to dummy parameter format (no hiddenStructure) at User:CBDunkerson/Sandbox3. A few different calls to this can be seen (along with some other ongoing projects) at User:CBDunkerson/Sandbox. It would be interesting to see whether the browsers which had trouble with CSS can handle this better. The calls to the template were left unchanged from the current format except for requiring the extra '|if=' parameter. Note that I used wiki-table markup except I used <td> for the newlines... which could then be included inside the default parameter to prevent blank lines. I don't think this format is particularly more complicated than hiddenStructure style. The need to add the extra parameter is the biggest issue. --CBD ☎ 00:31, 4 January 2006 (UTC)
- This thread is nothing more than more stonewalling against this policy. The hiddenStructure tricke is not perfect, but we must do everything we can to eliminate meta-templates. Lacking anything better, and "Weeble" is definitely not better), we must implement what we have. In a couple months, if the syntax changes or someone discovers something better, I'll be back at it, updating all the templates I'm working on right now. I don't care. What cannot happen is for people to delay or impede these conversations on the grounds that CSS isn't perfect. Let's get to work. If you don't want to do the work, then at least don't iuterrupt those that do. -- Netoholic @ 01:04, 4 January 2006 (UTC)
- No, this thread is discussion on the best ways to implement this policy. Compared to hiddenStructure, the 'MrWeeble' method offers greater accessibility and greater portability with only the cost of having to add '|if=' to each call to the templates. For many templates that seems like a reasonable tradeoff to me. There are over a thousand 'taxobox' template calls, so that's a little daunting to add all those 'ifs', but most templates don't get called that many times. --CBD ☎ 01:34, 4 January 2006 (UTC)
- you should have wikified discussion - it seems Netoholic does not know what this is. Tobias Conradi (Talk) 15:58, 4 January 2006 (UTC)
- No, this thread is discussion on the best ways to implement this policy. Compared to hiddenStructure, the 'MrWeeble' method offers greater accessibility and greater portability with only the cost of having to add '|if=' to each call to the templates. For many templates that seems like a reasonable tradeoff to me. There are over a thousand 'taxobox' template calls, so that's a little daunting to add all those 'ifs', but most templates don't get called that many times. --CBD ☎ 01:34, 4 January 2006 (UTC)
Netoholic, I am not "stonewalling against this policy". Indeed I agree with this policy. If something harms the servers and contributes to downtime then I say "kill it; kill it with a big stick". However, now we've accepted this policy, we need to determine what to do next to replace templates that use meta-templates for the hiding of lines that show. While there is some merit in going ahead and making unilateral changes, for something as important as this, I believe there should be consensus. At the moment there is not consensus, hence I thought I should raise my concerns about the hiddenStructure method in the hope that these can be resolved. In the interests of fairness and objectveness here are some Usability concerns with dummy parameter method:
- Requires a dummy parameter in each call of the template. This could be laborious to do manually, but should be relatively trivial to do with a bot.
- The code does not look pretty making it very hard for a newbie to edit.
- Due to both wikitables and templates using pipes, table structures need to be done in html, again this reduces options and thus reduces usability for editing it. – MrWeeble Talk Brit tv 12:07, 4 January 2006 (UTC)
- I think any one of those reasons is enough to shelf "WeebleCode" in favor of the CSS solution. CSS does work well, and really only marginally looks bad on lynx, which is less than 0.03% of our hits. The solution for lynx is to limit the number of optional fields. I'd love to discuss alternatives, but people are starting to believe that WeebleCode is gaining consensus. Neat trick, but bad implementation. -- Netoholic @ 16:03, 4 January 2006 (UTC)
- Actually, I think the major problem with hiddenStructure is that it doesn't work on Misplaced Pages mirrors unless each and every mirror individually includes hiddenStructure in its stylesheets. A large proportion of people reading Misplaced Pages content read it on a mirror site. --Gareth Hughes 17:12, 4 January 2006 (UTC)
- Mirrors have always had to adapt, so I'm unconcerned about them too much. But really, what do you think a mirror can do with WeebleCode anyway? It's based of a function that's built into the pre-alpha version of MediaWiki that Misplaced Pages runs. Moreover, it's entirely reliant on the way the MediaWiki software handles those default parameters. Mirrors get copies of the page and template sources, but most don't even use MediaWiki. You're telling me that adding a CSS class to their implementation is harder than rewriting their parser code?
- I'd be more worried about people who want to use content containing WeebleCode on the older (stable) 1.5.x and below versions of MediaWiki. Default parameters have not been activated on those releases and so WeebleCode has no chance of working. There is a chance it will never work, since 1.6.x isn't even in alpha state yet. hiddenStructure does work on the current stable/public version of MediaWiki. -- Netoholic @ 17:38, 4 January 2006 (UTC)
An alternative CSS trick that doesn't depend on a specific stylesheet is to use <span style{{{parameter|}}}="display:none;speak:none;">
. I've recently used it in Template:Starsx, and it appears to work fine (even in lynx, though that's a bit of a special case). —Ilmari Karonen (talk) 19:12, 7 January 2006 (UTC)
- That solution doesn't produce valid HTML, since styleFoo isn't an allowed attribute. It's OK to call undefined class names, as in the hiddenStructure method. I'm also curious why you say it works in lynx, when the point of that template is displaying images. -- Netoholic @ 19:56, 7 January 2006 (UTC)
- True, but it seems Tidy strips the bogus attribute away — and even if it didn't, user agents are supposed to ignore unrecognized attributes. As for lynx, it works in the sense that it displays a meaningful alt. text. As I said, though, this template is a special case since its main purpose is to show images; it may or may not be possible to make other templates using such tricks work in lynx. —Ilmari Karonen (talk) 21:15, 7 January 2006 (UTC)
Weeble Implementation
- I belive the portability and validity criteria really do turn us away from the hiddenStructure technique, and there seems to be gathering consensus that it not be used. I think we are fully aware of the drawbacks of the WeebleCode, but it seems CBD managed to work out how to retain the majority of template in pipe syntax with the WeebleCode. If we can have an agreed method of implementation and a few bots to add the dummy parameter, we could do some good work in reducing the use of meta-templates. --Gareth Hughes 12:41, 4 January 2006 (UTC)
I can not see how CBD's code works. I have tried to implement it, but it does not remove the lines, mereley removes the label from the line, leaving blank lines. I could be wrong, I suck at pipe syntax tables (been coding HTML tables for years - old dogs, new tricks). CBD, could you show us a test implementation?
The code at User:Adrian_Buehlmann/work/Infobox TV channel/2006-01-02 is a whole lot neater than my original version, and hopefully should be easier to edit.
As an additional comment, I feel that any templates that we hack in either of these ways should be tagged with a category (in noinclude of course), so that when a better method is implemented we can go through and re-reimplement them all. – MrWeeble Talk Brit tv 13:55, 4 January 2006 (UTC)
I segmented this out from the previous pros/cons section as both are getting large.
MrWeeble - definitely agree on the categorization. Both of these methods are kludges and we ought to keep track of them for later repair if a better methodology becomes available.
Take a look at the template:User Infobox which I just cobbled together and it's use on my User:CBDunkerson page. It makes extensive use of WeebleCode along with tables within tables. Still needs alot of polishing / expansion, but shows that the methodology is viable. As noted before, there's also User:CBDunkerson/Sandbox3 for a translation of {{taxobox}}... compare the coding on those two. They produce essentially identical output and have nearly the same coding, except that taxobox uses hiddenStructure and my Sandbox3 uses WeebleCode. Examples of Sandbox3 in use can be seen at User:CBDunkerson/Sandbox.
There is a blank line issue with this method, but you can usually work around it. The '!' symbol and <td> can be used inside a parameter default section to create horizontal and vertical cells... '!' being a header indicator means that it's use isn't always appropos, but I've been able to kludge something through for each situation I've encountered so far. I'll try to take a look at your latest 'Infobox TV channel' to see if I can figure out how to adjust it to this format. --CBD ☎ 14:35, 4 January 2006 (UTC)
- That looks good. It's obviously not a straight substitution, and some thought is needed to convert existing templates to WeebleCode. As no real solution seems to be on the horizon, it seems that this is the best kludge we have. To focus minds, the way forward seems to be:
- Develop draft versions of existing meta-template templates rewritten with WeebleCode.
- Ask others to cross-check and test them.
- Get a few bots to carry out the insertion of dummy parameters into articles (offers please!).
- Switch the template to the draft version, and tweak if necessary.
- We can start on phase 1 right away. --Gareth Hughes 15:09, 4 January 2006 (UTC)
Why only on enwiki?
If this is a policy for technical reasons, why is it an enwiki-only policy? --Pjacobi 23:18, 3 January 2006 (UTC)
- Good question. My best guess is that meta-templates haven't been implemented as extensively on other wikis or the server load is just less in general. --CBD ☎ 14:15, 4 January 2006 (UTC)
- plus en is just a lot bigger and busier than the others, so meta templates there are less likely to get hit. I guess on the other sites they are hoping that perfomance issues can be fixed in mediawiki before it becomes a problem for them. – MrWeeble Talk Brit tv 15:54, 4 January 2006 (UTC)
- Because I haven't translated it into Latin. Phil Sandifer 16:35, 6 January 2006 (UTC)
- For starters: devitatote subformulae! --Gareth Hughes 16:56, 6 January 2006 (UTC)
Random
I've come up with two (related) ways of building a 'random number' generator in Wiki-markup. However, one method would require thousands of parameters to be evaluated (with all but one being unpassed). The other method could cut that to hundreds of parameters, but would require the template to be manually updated every few days. Is evaluating hundreds (or thousands) of unset parameters in a template resource intensive? That is, if I had a template which lists parameters 1 to 1000, returning a different number for each, but I only passed in parameter 732 would the template take significantly longer to evaluate than if 732 were the only parameter it was anticipating? Assuming that parameter switching isn't a computational drain... do I dare go there? Once something like this is developed it could easily be converted to a generic {{random}} template which might then be called by other templates (meta-templating) or fed into other templates as a parameter (multi-templating). Is this too much of a 'genie out of the bottle' issue or can it be implemented in a limited fashion without hurting anything? And yes... I know I'm evil. --CBD ☎ 15:33, 6 January 2006 (UTC)
- We have no use for this. Go write an encyclopedia. -- Netoholic @ 16:02, 6 January 2006 (UTC)
- Setting aside the usual pleasant attitude... I disagree. I think this could be useful to 'us' in building an encyclopedia. Part of our effort is showcasing the work we have done. That's why we have a 'Main Page', 'Portals', and 'Featured' content. The ability to randomly display different 'showcased' material each time someone views a page would unquestionably be beneficial in promoting the encyclopedia. The question is whether it is computationally sound or not. --CBD ☎ 17:01, 6 January 2006 (UTC)
- 1000 Parameters? This is definitely "over-egging the pudding". I agree with Neto, though as usual he could have been a little bit more diplomatic :-). Adrian Buehlmann 17:06, 6 January 2006 (UTC)
- Uncyclopedia solves this problem the way it should be solved, with an extension. -- Cyrius|✎ 20:58, 6 January 2006 (UTC)
- That would undoubtedly be the very best solution. Adrian Buehlmann 21:39, 6 January 2006 (UTC)
Proposed renaming
I propose this be renamed to Misplaced Pages:Never use meta-templates (with the shortcut being WP:NUMT). Having it named "Avoid using meta-templates" implies there are cases where meta-templates are okay, and that's just a little too confusing for people being hit over the head with this I imagine. —Locke Cole • t • c 07:38, 8 January 2006 (UTC)
- I've been thinking about that myself, but not how you are. The term "meta-template" is the source of a lot of confusion. I'm thinking something like "Don't use nested templates", although with that, we're really approaching the point where people may ask why that isn't removed from the software completely. -- Netoholic @ 09:04, 8 January 2006 (UTC)
- Agreed. The meaning of the word is not clear.
- I thought the whole point of making this policy was to make a temporary kludge because these changes couldn't be made to the software. — Omegatron 09:38, 8 January 2006 (UTC)
- Perhaps one way to better educate people (such as myself, I admit) would be to point to examples of where meta/nested templates are OK/good for the encyclopedia. Or, just turn the feature off in software if there aren't any OK/good examples. —Locke Cole • t • c 09:31, 8 January 2006 (UTC)
- I agree... move to Misplaced Pages:Don't use nested templates and make the shortcut WP:DONT. ALKIVAR™ 10:56, 8 January 2006 (UTC)
- Agreed. Adrian Buehlmann 12:45, 8 January 2006 (UTC)
- I think it's too strong. Heck, the Main Page uses nested templates. Avoid and don't mean different things. If anything I'd think we should just add more text to the policy to explain that it is extensive template nesting linked to many pages which causes problems... not simple cases of double transclusion which appear on one page. --CBD ☎ 14:21, 8 January 2006 (UTC)
- We could list the allowed exceptional cases. Adrian Buehlmann 16:31, 8 January 2006 (UTC)
- If only identified exceptions are 'allowed' then what you are talking about is a significant, and in my opinion unwise, policy change. Is there really any reason to go after all the users who have 'Babel' templates (which are meta-templates after all) on their user-pages? All those who put Babel and other template calls on a sub-page and then transclude that into their user page? Meta-templates... but absolutely insignficant in terms of server load. The policy is "Avoid"... there are uses of meta-templates which can cause unspecified but significant strain on the servers. We should be tracking those down and eliminating them. Not changing the policy to "Don't" and hassling a much larger population for no good reason. The problem is that 'Joe user' doesn't know which meta-templates are likely to cause significant drain and which aren't. Right now a bunch of people (mostly on this page) are figuring that out for them. Maybe we ought to have a 'Wikiproject templates' to help sort out these and other conditional template issues. --CBD ☎ 11:58, 10 January 2006 (UTC)
- I agree with you. But it will be a hard job. And there is no consensus yet what qualifies as acceptable meta template and what not. I assume that Neto wants to extinct every meta template. I fear there will be a lot of stressy edit wars over this, which also harms the servers. People may say: "Oh that's not fair. Group X over there is allowed to that meta and we are not!". But we could give it a try. Adrian Buehlmann 13:05, 10 January 2006 (UTC)
- If only identified exceptions are 'allowed' then what you are talking about is a significant, and in my opinion unwise, policy change. Is there really any reason to go after all the users who have 'Babel' templates (which are meta-templates after all) on their user-pages? All those who put Babel and other template calls on a sub-page and then transclude that into their user page? Meta-templates... but absolutely insignficant in terms of server load. The policy is "Avoid"... there are uses of meta-templates which can cause unspecified but significant strain on the servers. We should be tracking those down and eliminating them. Not changing the policy to "Don't" and hassling a much larger population for no good reason. The problem is that 'Joe user' doesn't know which meta-templates are likely to cause significant drain and which aren't. Right now a bunch of people (mostly on this page) are figuring that out for them. Maybe we ought to have a 'Wikiproject templates' to help sort out these and other conditional template issues. --CBD ☎ 11:58, 10 January 2006 (UTC)
- We could list the allowed exceptional cases. Adrian Buehlmann 16:31, 8 January 2006 (UTC)
- I agree... move to Misplaced Pages:Don't use nested templates and make the shortcut WP:DONT. ALKIVAR™ 10:56, 8 January 2006 (UTC)
- Perhaps one way to better educate people (such as myself, I admit) would be to point to examples of where meta/nested templates are OK/good for the encyclopedia. Or, just turn the feature off in software if there aren't any OK/good examples. —Locke Cole • t • c 09:31, 8 January 2006 (UTC)
- Misplaced Pages:Avoid nested templates, an explanation of what "nested template" means, what it doesn't mean, examples of templates that have been modified because of it ("Template X did nothing but format messages boxes. It has been replaced by CSS class Y, which provides the same functionality but with the following benefits and none of the server load problems"), and examples of templates (like those on the main page) that won't be modified. — Omegatron 17:21, 8 January 2006 (UTC)
Nope. Avoid avoid. Adrian Buehlmann 18:48, 8 January 2006 (UTC)Change my mind. Seems to be the least evil for now. Nested templates is better than "meta templates". I see there is consensus to keep the word "avoid" but to use "nested templates". So I support that now. Adrian Buehlmann 13:08, 10 January 2006 (UTC)
Another idea, move this page and use it as a seed for a Misplaced Pages:Template policy. -- Netoholic @ 17:41, 9 January 2006 (UTC)
- No. Too broad. Adrian Buehlmann 13:05, 10 January 2006 (UTC)
Transitioning and alternatives
OK, now that this has escalated to an official policy then what are the plans for transitioning and converting existing meta-templates? One alternative to m:Help:Array may be the data storage tool which Jimbo mentioned last year; what is the implementation status of that? I think one example was to store information such as the current capitol or president of a country. (SEWilco 10:03, 10 January 2006 (UTC))
- There are a couple of 'in the works' changes which might allow meta-templates to be replaced with a built-in implementation. However, no clue when/if those will happen. In the mean-time two methods of replacing meta-template functionality have been developed. However, neither is perfect and both have benefits/drawbacks the other does not. Unfortunately, they might both break if the default handling for unset parameters changes. Extensive commentary on the 'CSS trick' and 'WeebleCode / parameter default trick' can be found on this page. There are also a number of more flexible variations on each (inline CSS, doing 'or/and/not' parameter checks, et cetera) which probably ought to be collected somewhere for reference. Several major meta-templates have already been transitioned over to these methods. --CBD ☎ 12:13, 10 January 2006 (UTC)
Conversion Template
Currently there are some discussions about Conversion Templates ] . In particular the following convertions template have been ruled as "disallowed by policy" in WP:AUM.
- Template: {{Born|1919|7|20|region=NZ}} that correctly puts Edmund Hillary into the Category:New Zealand people and Category:1919 births. And correctly formats the dates as per wiki standard.
Also:
- Template: {{Locale length|1000}} that Converts meters to feet eg. {{Locale length|10}} gives 10 m (33 ft) and {{Locale length|1000}} gives gives 1000 m (3281 ft), useful when globalising metric measurments (without imperial feet) are encountered in some pages. Also can be used to insert no-line-break space after the between number and unit. eg 1000 m, this is commonly missed and leads to messy pages.
I am thinking that we need more of these kind of template, not less. Can someone point me to some stats on how these kind of template effect the performance of mediawiki (I don't have mediawiki installed on any of my machines).
There is a comment c.f. that states that template encourage vandalism by forcing the vandal to manually change many pages. This "protection" comes at a cost as it means that real contrubutirs must also update the same pages manually. Fortunately we still have more contributors then vandals (for the foreseeable future). Can we drop the comment Misplaced Pages:Avoid_using_meta-templates#Vandalism as it is a bit self defeating? An alternative would be to stop anonymous (or new) contributors from creating Templates.
NevilleDNZ 11:48, 11 January 2006 (UTC)
- I have stroked and nowikied the template transclusions in the above posting due to a massive amount of text transcluded into here. Adrian Buehlmann 12:07, 11 January 2006 (UTC)
- $10 CASIO calculator to the rescue... I have manually added the standard height calculation required in the example. NevilleDNZ 12:20, 11 January 2006 (UTC)
- Ok :-). See also my posting on Template talk:Locale length. --Adrian Buehlmann 12:24, 11 January 2006 (UTC)
- (triple edit conflict)Sorry, my fault. I was converting the template, but hadn't updated the call yet. I changed this from a meta-template which calls one of 10,000 other templates to a single template which triggers one of 10,000 parameters. To do so the call has to change from {{Locale length|7}} to {{Locale length|7=m}}. The 'm' isn't really relevant, you can set it equal to anything... just need to define one parameter as the only one being set. This now begs the question... is this massive parameter switch as bad (or worse) than the massive meta-template in terms of server load? I'm assuming they're both ugly, but worth exploration. --CBD ☎ 12:26, 11 January 2006 (UTC)
- Um. Could you please confirm: 10,000 (in words: ten thousand) templates/parameters? --Adrian Buehlmann 12:31, 11 January 2006 (UTC)
- You heard (ok, read) me. That's how the conversion works. It calls a template P1, P2, P3... P10000. There are no mathematical functions in Wiki so each instance (1-10000 meters) must be identified and responded to independantly. BTW, it takes so long to sort out the parameters that if you have three of these calls on the same page it just gives up. I'm reverting to the other version and think we should definitely kill this thing. However, it makes me wonder if the parameter switching we are using to replace meta-templates isn't actually worse. --CBD ☎ 12:36, 11 January 2006 (UTC)
- As I already said a longer time ago on this matter: "Premature optimization is the source of all evil" (reference: Premature optimization) :-) Adrian Buehlmann 12:43, 11 January 2006 (UTC)
- Just a possibility. This is a pretty unusual case. It's really only 'double transclusion', but the second layer can be one of any 10000 templates... but that's set with a single parameter. So this isn't that bad as meta-templates go... but monstrous as parameter switches go. Something we need to keep in mind - in some cases the meta-templates are better. Especially if this one is subst'd in. --CBD ☎ 12:48, 11 January 2006 (UTC)
- As I already said a longer time ago on this matter: "Premature optimization is the source of all evil" (reference: Premature optimization) :-) Adrian Buehlmann 12:43, 11 January 2006 (UTC)
- Indeed I cant believe it. Patrick made template P1..P3 and NevilleDMZ continued them up to P10000. So we have now 10000 templates for that on Wiki:en. Grumble.... Looking for my big stick... (Oh boy, if Neto sees that :-) --Adrian Buehlmann 12:51, 11 January 2006 (UTC)
- Who do you think put it on TfD? :] --CBD ☎ 12:56, 11 January 2006 (UTC)
- You heard (ok, read) me. That's how the conversion works. It calls a template P1, P2, P3... P10000. There are no mathematical functions in Wiki so each instance (1-10000 meters) must be identified and responded to independantly. BTW, it takes so long to sort out the parameters that if you have three of these calls on the same page it just gives up. I'm reverting to the other version and think we should definitely kill this thing. However, it makes me wonder if the parameter switching we are using to replace meta-templates isn't actually worse. --CBD ☎ 12:36, 11 January 2006 (UTC)
- Um. Could you please confirm: 10,000 (in words: ten thousand) templates/parameters? --Adrian Buehlmann 12:31, 11 January 2006 (UTC)
- (triple edit conflict)Sorry, my fault. I was converting the template, but hadn't updated the call yet. I changed this from a meta-template which calls one of 10,000 other templates to a single template which triggers one of 10,000 parameters. To do so the call has to change from {{Locale length|7}} to {{Locale length|7=m}}. The 'm' isn't really relevant, you can set it equal to anything... just need to define one parameter as the only one being set. This now begs the question... is this massive parameter switch as bad (or worse) than the massive meta-template in terms of server load? I'm assuming they're both ugly, but worth exploration. --CBD ☎ 12:26, 11 January 2006 (UTC)
- Ok :-). See also my posting on Template talk:Locale length. --Adrian Buehlmann 12:24, 11 January 2006 (UTC)
- $10 CASIO calculator to the rescue... I have manually added the standard height calculation required in the example. NevilleDNZ 12:20, 11 January 2006 (UTC)
NevilleDNZ, I like the concepts but the way these templates work is problematic. The country one might be convertable to a non-meta format. Take a look at what I did at User:CBDunkerson/Sandbox for the distance conversion templates. It can all be done in a single template call... the problem is that the distance conversion has so many possible parameters that it just takes forever to evaluate. Countries shouldn't be as bad. Also, if these are subst'd in rather than pasted as templates they wouldn't cause much disruption, but that would have to be watched carefully. --CBD ☎ 12:48, 11 January 2006 (UTC)
Bloody hell. IF YOU WANT A NEW FUNCTION (like conversions) ADDED TO WIKIPEDIA, SUBMIT A FEATURE REQUEST. Stop misusing the template namespace as programming tool! -- Netoholic @ 18:31, 11 January 2006 (UTC)
- :-) --Adrian Buehlmann 18:45, 11 January 2006 (UTC)
- Groan... if wikipedia STILL does not have a calculator/conversion tool (as per my $10 CASIO calculator), what hope does any desperately needed "FEATURE REQUEST" have... seriously? Besides mediawiki is not paper, we can take advantage of the computer to do some of the more mundane tasks. (eg standard conversions)
- subst "Groan" for "Bloody" Hell if you want more sound effects. NevilleDNZ 21:29, 11 January 2006 (UTC)
- Well said. If there are restrictions on the syntax, try thinking why they are there and working with them, rather than trying to poke holes in them in the manner of a high school hacker. ] 23:49, 11 January 2006 (UTC)
Banning meta-wiki to stop vandalism??
There is a comment c.f. that states that template encourage vandalism by forcing the vandal to manually change many pages. This "protection" comes at a cost as it means that real contrubutors must also update the same pages manually.
It fall into the category of "to cut ones nose of inspite of ones face".
Fortunately we still have more contributors then vandals (for the foreseeable future). Can we drop the comment Misplaced Pages:Avoid_using_meta-templates#Vandalism as it is a bit self defeating?
An alternative would be to stop anonymous (or new) contributors from creating Templates.
NevilleDNZ 21:29, 11 January 2006 (UTC)
- Hmmm... Stopping anons from editing in the Template: namespace seems like a good idea at first glance, just like regular users are prevented from editing in the Mediawiki: namespace.
- Did you see Misplaced Pages:High-risk templates? — Omegatron 21:39, 11 January 2006 (UTC)
- Restricting the Template space is sounding better to me all the time. After all, NevilleDNZ only had been here two months and made only a couple hundred edits before creating his templates. -- Netoholic @ 21:44, 11 January 2006 (UTC)
- Hey... that was my idea... Are you trying to shoot the messanger? :-) NevilleDNZ 23:42, 11 January 2006 (UTC)
Misnomer
Can we start calling them "nested templates", "conditional templates", "style templates", and so on instead of "meta-templates"? "Meta-templates" would technically be templates about templates; not within, and it's being used for every different type at the same time. "Nested" is a much better word for the term meant here.
And yes, that's an article name change request, too, regardless of whether we prepend it with "avoid", "never use", or whatever.
I'm itching to just move it to Misplaced Pages:Avoid using nested templates, but I fear even this small change would lead to a vicious edit war. If another admin agrees, just move it, and the severity of the title can still be fought about in the above section. "Nested template", though, is a more accurate term for the object described in the first paragraph. — Omegatron 22:31, 11 January 2006 (UTC)
- Misplaced Pages:Avoid nested templates would be more succint, but yes, I agree. —Ilmari Karonen (talk) 22:50, 11 January 2006 (UTC)
- I agree with the rename to "Avoid nested templates". "Avoid using nested templates" is also ok. I would prefer "Avoid nested templates" over "Avoid using nested templates".--Adrian Buehlmann 22:57, 11 January 2006 (UTC)
- Is it an insect or a female relative? --Gareth Hughes 23:13, 11 January 2006 (UTC)
- Heh. Fun with acronyms. :] --CBD ☎ 23:48, 11 January 2006 (UTC)
- prefer the female relative :) Tobias Conradi (Talk) 00:48, 12 January 2006 (UTC)
- I prefer the insect. That also describes quite well my position in relation to WP:AUM :-). --Adrian Buehlmann 10:07, 12 January 2006 (UTC)
- Heh. Fun with acronyms. :] --CBD ☎ 23:48, 11 January 2006 (UTC)
- Is it an insect or a female relative? --Gareth Hughes 23:13, 11 January 2006 (UTC)
Prefer to keep at present location over both those options. -- Netoholic @ 23:16, 11 January 2006 (UTC)
Note: I added template:Moveprotected on top of the project page because it is protected against moves. --Adrian Buehlmann 09:34, 12 January 2006 (UTC)
- Nope. reverting myself. Sorry. --Adrian Buehlmann 10:29, 12 January 2006 (UTC)
CSS hack reduces accessibility
I just learned about the CSS hack being added to a number of templates, to compensate for a changed policy on template transclusion. I understand that there is an alternative, but this is being implemented because its easier.
This hack injects junk code into the body of the page, then hides it from most visual browsers using CSS. This makes Misplaced Pages less accessible for users of assistive technologies, like web page readers for the handicapped, and text readers. This is sloppy programming and bad practice from the point of view of usability and accessibility. Misplaced Pages is an open encyclopedia; please lets not start treating the minority who has the most difficult time reading like second-class citizens. —Michael Z. 2006-01-16 17:51 Z
- Having web sites which are inaccessible also violates assorted corporate policies and laws, which might affect who is able to host mirrors. A related side effect is that if the MediaWiki does not support an accessible version of a desired feature then MediaWiki will be less likely to be used for non-Misplaced Pages sites. (SEWilco 19:04, 16 January 2006 (UTC))
EVERYONE - in order to quash this ForestFire, please follow-up discussion at MediaWiki talk:Common.css#CSS hack reduces accessibility. -- Netoholic @ 19:08, 16 January 2006 (UTC)
On Babel
Somewhere way up there on this talk page — someone who doesn't find the whole debate headache-inducing can find exactly where — it was remarked that the Babel templates break this rule/guideline/sharp note from the developers. Simply substing the Babel templates does not appear to break them — does this solve the problem, and if so, who volunteers to go and gently explain this to the folks over at the relevant WikiProjects, taking into account the fact it has, briefly and fruitlessly, been brought up before? ~J.K. 08:25, 17 January 2006 (UTC)
- It's worth noting that the Babel templates aren't really any worse than other userboxes in terms of server load. In fact, using the Babel-N metatemplates even saves one template call compared to using {{Boxboxtop}} and {{Boxboxbottom}} and directly including the Babel boxes in between. —Ilmari Karonen (talk) 13:20, 17 January 2006 (UTC)
- That said, an underlying problem is that Babel boxes on the English Misplaced Pages have their styles hardcoded into the templates. On some other Wikipedias (such as Italian) the styling is done with CSS classes, which makes the boxes much more cleanly substable. —Ilmari Karonen (talk) 13:31, 17 January 2006 (UTC)
- As Ilmari Karonen explains, this is an example of a situation where something is a 'meta' (nested) template, but it really doesn't cause any notably greater strain to the servers than a non-meta template would. The difference between {{Babel-3 |en-4|de-1|qu-2}} and {{Babel-N |1={{User en-4}}{{User de-1}}{{User qu-2}}}} (or the 'boxtop' / 'boxbottom' method) in terms of server load is infintessimal. I'd like to see the numerous 'Babel-#' templates cut down to just a few, but in terms of server load I really don't see a significant problem with them. --CBD ☎ 13:57, 17 January 2006 (UTC)
Complete rewrite
I think this policy needs to be re-written. The way it is currently written and applied are completely different and the issues are not spelled out properly. For instance, the policy defines meta-templates as "those that are created and used to keep other templates in a standard format". The 'meta' acutally makes sense for that definition, but it has since become common to call virtually any 'nested' template a 'meta-template'. The original true "meta" templates were generally just double transclusions like those on the Main page to keep templates being called in a standard size/format. At that time this was just a 'guideline' because there were some concerns that excessive use of such might cause problems if some standard formatting template were changed. Since then much bigger issues have been introduced by templates which don't 'format' anything, but instead handle conditional logic. Technically, these aren't even covered under the policy as currently worded... though they were actually the reason for upgrading it to a policy in the first place.
Further, the root problems driving the policy really have nothing to do with 'meta' or 'nested' templates per se... it is only the utility of those applications which makes them somewhat more likely to run afoul of the server issues. A 'simple' template can cause 'update' and 'rendering' problems every bit as great as any 'nested' template. As such, I'd suggest redoing this policy as something like Use templates wisely and specifically explaining the problems caused by updating templates which are linked from numerous pages and rendering templates which contain alot of template calls and/or parameter conditions. We should be working towards making less server intensive templates in general rather than trying to eliminate a certain (incorrectly defined) class of templates which are often, but not always, the biggest problems. --CBD ☎ 12:47, 17 January 2006 (UTC)
Forcing Substitution?
UPDATE: Please see User:DCrazy/Force Static for a complete proposal. I realized that merely auto-subst'ing templates isn't enough to reduce the server stress induced by meta-templates. --DCrazy talk/contrib 21:03, 17 January 2006 (UTC)
Alright, why don't we cut a comprimise? Create a keyword like __FORCE_SUBST__, and whenever a template including that keyword is used, it is automatically substituted. Then someone who vandalizes, say, Template:User wikipedia, will not cause any damage whatsoever to existing pages nor cause additional server load by invalidating the cache. To make editing easier, templates could offset their content with comments, like < !-- Begin/End Template:Babel -- > (comment deliberately broken, for obvious reasons). We get to keep one of the most powerful features of Templates while eliminating most of their risk -- a fair tradeoff in my book. --DCrazy talk/contrib 14:20, 17 January 2006 (UTC)
- Looks damned interesting. Um, you broke that comment here because it was too tedious for you to write <!-- Begin/End Template:Babel-->, right? --Adrian Buehlmann 16:00, 17 January 2006 (UTC)
- Heh. Forgot about HTML entities. Yes, that is what it would look like. --DCrazy talk/contrib 16:57, 17 January 2006 (UTC)
- Next question: you mean that a template X that contains __FORCE_SUBST__ would then behave exactly as if one had writen
{{subst:X}}
in the edit window, even if one writes just{{X}}
into the edit window? --Adrian Buehlmann 17:12, 17 January 2006 (UTC)
- That's the idea, though I'm not entirely sure if
{{subst:X}}
inserts X's source or its output given any parameters. The latter is preferable, because that means that, for example, all issues with templates that use {{qif}} aren't a problem if they are __FORCE_SUBST__ed. --DCrazy talk/contrib 18:30, 17 January 2006 (UTC)
- That's the idea, though I'm not entirely sure if
- Note that templates that use qif cannot be substed. --Adrian Buehlmann 19:25, 17 January 2006 (UTC)
- I've seen suggestions for this before and it would absolutely be a good thing to have - particularly for templates which are intended as once-offs ('welcome', 'test1', et cetera). As such... yeah it would be great if someone were to develop such a thing. It would probably do more to reduce server load than all of the 'meta-template removal' work going on now. However, there is another aspect of templates which this wouldn't address. Many, possibly even most, templates are used to create a common format for certain types of information. If those templates are subst'd then any future change to the format has to be made individually in each instance... rather just than the template being adjusted and all existing uses automatically updating. --CBD ☎ 14:32, 17 January 2006 (UTC)
- Yes but in one of the cases mentioned above the Welcome template for example... even if it changes in the future there is no need to update it on previous talk pages. Just as there is no need for updating a vandal warning. The point is across and while there will always be minor tweaks to the content the general message has made it across. ALKIVAR™ 15:01, 17 January 2006 (UTC)
- That's a great idea. Some templates are just fine subst'd, or should be in every case, but many should not be. The long-term damage done by subst'ing all those templates and removing their auto-updatability is worse than the short-term damage caused by server load. If we can offset the server load by always substing templates that should always be substed, we can relax about the others. — Omegatron 15:09, 17 January 2006 (UTC)
- Using templates mainly for formatting suggests to me that there needs to be better usage of CSS classes for formatting and styling, as mentioned above by Ilmari Karonen. At present it is easier to create a template to do the formatting than to get anything added to one of the stylesheets as they are protected and the template namespace is not. Looking at common.css, changes are proposed at Misplaced Pages:Village Pump rather than any specific policy or discussion area. Maybe there should be a specific method whereby rules can be proposed by users, checked by admins to ensure that nothing breaks, that they degrade well and comply with accessible rules and added as per the request. just my €0.02 worth. – MrWeeble Talk Brit tv 15:17, 17 January 2006 (UTC)
- Well, a lot of "formatting" issues aren't really formatting issues... {{Locale length}} is kind of both, in that it standardizes the style used for measurements but also provides content above beautification. {{Locale length) is an incredibly easy and obvious candidate for something along the lines of __FORCE_SUBST__. The more complicated a template gets, the less of a candidate it is for forcing substitution. But the great thing is that a lot of templates are complicated on the inside, but their output is not. Take, for example, {{Misplaced Pages:Babel}}. The source for that is hideous, but its output is a standard wikitable. This brings the question, does subst'ing a template insert its source or its output given its parameters? I really hope it's the former, because that makes all of our problems go away if we force subst'ing on numerous templates. --DCrazy talk/contrib 16:56, 17 January 2006 (UTC)
- Using templates mainly for formatting suggests to me that there needs to be better usage of CSS classes for formatting and styling, as mentioned above by Ilmari Karonen. At present it is easier to create a template to do the formatting than to get anything added to one of the stylesheets as they are protected and the template namespace is not. Looking at common.css, changes are proposed at Misplaced Pages:Village Pump rather than any specific policy or discussion area. Maybe there should be a specific method whereby rules can be proposed by users, checked by admins to ensure that nothing breaks, that they degrade well and comply with accessible rules and added as per the request. just my €0.02 worth. – MrWeeble Talk Brit tv 15:17, 17 January 2006 (UTC)
A "__FORCE_SUBST__" option has been proposed a few times in the past. The problem seems to be that you can't control where it gets inserted, and the vast majority of templates are on very few watchlists. If someone say added "__FORCE_SUBST__" to a highly-used but rarely-edited/low-watchlisted template, every time a downstream page was edited after that point, the template would be subst'd in. Editors may not notice for hours or days, at which point many articles would no longer be linked to that template. There's not much chance of recovery if that happens. -- Netoholic @ 18:45, 17 January 2006 (UTC)
- I think the proper solution in this case would be to lock the Template namespace from editing by anons, but that's a WHOLE other can of worms. From a strictly technical point of view I think that __FORCE_SUBST__ is a good idea. Overall, taking things like vandalism into account, the picture gets muddier. --DCrazy talk/contrib 18:50, 17 January 2006 (UTC)
- I'm not really saying this would only happen when a vandal/new user does it. Anyone who thinks innocently (but wrongly) "This template is better subst'd" could cause unrecoverable problems. -- Netoholic @ 18:55, 17 January 2006 (UTC)
- Hrmm. Well, in that case maybe forcing substitution would be an admin-only privilege. That seems to work well with protection/semi-protection. And actually this is where the two problems merge: the technical issue is that meta-templates cause additional server load whenever one of the contributing templates is modified. Plain-old subst won't help since that creates a mess in the page's source and doesn't actually remove the conditions and other things associated with the template, offering zero benefit. The problem increases with the popularity of the meta-template. This catches the attention of admins.
- But since the only real problem is posed by popular templates, and admins will be more aware of those (meta-)templates than the more obscure ones, giving admins control over forcing substitution (actually pre-rendering, as determined below) would offer a solution for the templates that cause the biggest problem.
- The only remaining issue is what to do if page X includes force-subst'd template Y, someone vandalizes template Y, and then someone edits page X. This is an unrecoverable situation, which can only be mitigated (preventing anons from editing in the Template namespace, for example) but never eliminated. Proper guidelines would help immensely; templates that are extremely unlikely to change, such as {{Locale length}}, would be great candidates for force-substitution, and would need little to no debate before being implemented as such. --DCrazy talk/contrib 19:34, 17 January 2006 (UTC)
BLAST! Apparently subst: copies the template's source, not its output (just tried it on the sandbox using {{X1}} which included {{X2}} -- net result was {{X2}} in the source of the sandbox). So __FORCE_SUBST__ would require a different behavior than just mimicking subst: in order to be truly effective. --DCrazy talk/contrib 18:50, 17 January 2006 (UTC)
- Nevertheless your idea goes in a good direction. See also my talk with Rick Block on a similiar theme. --Adrian Buehlmann 19:25, 17 January 2006 (UTC)
- Note that WP:SUBST maintains a list of tempaltes which are bot-subst'd on a regualr basis. This is not the same as a would-be "__FORCE_SUBST__", but in many cases it does the job well-enough. Would it serve the desired purposed here, at least pending a feature implemetation? DES 20:45, 17 January 2006 (UTC)
- Not really... see my article on the matter for why subst: doesn't cure all the ills inflicted by meta-templates. Bots that auto-subst are a great resource, but don't do everything necessary (unless someone were to write a bot that parsed the template and inserted its final, processed wikitext into the page). Still, it's a start. --DCrazy talk/contrib 21:03, 17 January 2006 (UTC)
- If a bot running around updating all subst'd templates is more efficient and better for the servers than an actual template, why not just modify templates to make them behave like a bot? — Omegatron 22:29, 17 January 2006 (UTC)
- Timing, consistency, surprised editors? But the general idea is marvelous. Just needs some further timbering. --Adrian Buehlmann 22:36, 17 January 2006 (UTC)
- I think what you're suggesting is that doing
{{X}}
would copy the end result of X into the document in all instances, and any changes to X would cause the software to spider through the encyclopedia and update the text. This is a few major problems: it would involve a full-text search of every page of Misplaced Pages, in all namespaces. Obviously this is not a good idea. Also, if someone changes a template to consist of the word "the", and then changes it to something else, the software will wind up altering every instance of the word "the". Cataclysmic, especially because this still means that changes are not revertable. Misplaced Pages would be irreversibly destroyed in literally less than one second. --DCrazy talk/contrib 23:13, 17 January 2006 (UTC)- That's only a little bit crazier than the things people are doing right now.
- But that's not what I meant anyway. I meant that when a template is updated, the instances in each article's rendered version aren't updated instantaneously, or only updated when the page is edited, or something. Jamesday once suggested that a "feature" could be added to Mediawiki to turn off template transclusion completely during periods of intense server load (like search is turned off sometimes):
- The short-term technical expedient which is likely to work is adding a switch to turn off template expansion and flipping that switch, causing template text values to be displayed instead of template contents.
- So it doesn't seem unlikely to make an intermediate emergency switch that only turns off or staggers the template updating instead. The problem isn't the fact that templates exist, it's that the cache updating, in Jamesday's words, is "all grouped together in one big lump".
- Any technical kludge that saves the dependencies and structure of the templates while reducing server load would be better than these css-hack/weeblecode/subst'ing-everything-in-sight crocks. If the intermediate "switch" couldn't be written, I'd rather have the template expansion switch written, honestly. Turn off templates completely for short periods of time rather than go through all this fighting, revert warring, horrible kludges, and hostility. I wouldn't be surprised if the revert warring of templates over this page contributes more to the server load than the original problem. — Omegatron 02:33, 18 January 2006 (UTC)
- Hmm. We could write a client side compiler for Wikipedians and use a higher level language to craft wiki pages. For article X we could put our new language ("wiki++"?) source under X/src and edit that, compile to article X with wiki++ templates expanded (of course wiki++ has "if", "or", "not" "switch", local constants and whatever we'd love to have). What exciting times this could be... (I'm a wanna be coder :-) --Adrian Buehlmann 22:13, 17 January 2006 (UTC)
- I'm sure you could do this quite easily with a java application. (NB I don't write java) ] 22:32, 17 January 2006 (UTC)
- And then someone edits X and now X and X/src are out of sync. Recompiling X/src destroys X. --DCrazy talk/contrib 23:08, 17 January 2006 (UTC)
- Yup, I know. Make a policy to only edit X/src? Or implement it in MediaWiki (a compile button!). --Adrian Buehlmann 23:13, 17 January 2006 (UTC)
- So basically all that does is replace wikitext with a different language. Users would edit in 'wiki++', which would be compiled to wikitext, which upon first page request would be converted to HTML and cached. That buys us nothing at all. --DCrazy talk/contrib 23:15, 17 January 2006 (UTC)
- My idea would be along the line: Have wiki source to edit (includes template calls). Save expands all templates, store result and build html from that. So templates would only be updated to an article per editor request. Hyper luxory substing.--Adrian Buehlmann 23:21, 17 January 2006 (UTC)
- That seems ridiculously complicated. It would become far too difficult for newbies to edit pages. --bainer (talk) 23:24, 17 January 2006 (UTC)
- Why? The wiki source could be the same as today (with template calls). But we could use meta-templates because they would no longer hurt the servers. --Adrian Buehlmann 23:29, 17 January 2006 (UTC)
- If you ban editing X directly, and instead make users edit X/src, and compile that to HTML on demand, how is that different from merely editing X? Currently users edit X, the wikitext gets stored in the DB, and gets compiled to HTML on first access (which is usually right after clicking the Save Changes button). So in effect, all you are doing is adding meta-templates and other good stuff to wikitext directly (whether the resulting set of features is called something else is irrelevant). To tell you the truth that would be the best idea, as the PHP engine would do ifs and stuff far better and faster than the wikitext parser. But barring addition of new tags to wikitext (<if condition=""> and the like -- would be nice and neat and lovely and fast and so on), forcing-static is the best soluition I can see. Wikitext would continue to function exactly as is right now, but the potential damages would be mitigated.
- Forget about that ugly X/src. That was just a crap solution I used to show my idea. I think it would be worth to spin our ideas to more detail. I also fear we might to some degree misunderstand each other and based on that reject an idea prematurely. What about working together on a page under my user space. For example: User:Adrian Buehlmann/Lazy templates? I invite you (and anyone interested) to edit with me there. --Adrian Buehlmann 23:48, 17 January 2006 (UTC)
- If you ban editing X directly, and instead make users edit X/src, and compile that to HTML on demand, how is that different from merely editing X? Currently users edit X, the wikitext gets stored in the DB, and gets compiled to HTML on first access (which is usually right after clicking the Save Changes button). So in effect, all you are doing is adding meta-templates and other good stuff to wikitext directly (whether the resulting set of features is called something else is irrelevant). To tell you the truth that would be the best idea, as the PHP engine would do ifs and stuff far better and faster than the wikitext parser. But barring addition of new tags to wikitext (<if condition=""> and the like -- would be nice and neat and lovely and fast and so on), forcing-static is the best soluition I can see. Wikitext would continue to function exactly as is right now, but the potential damages would be mitigated.
- Why? The wiki source could be the same as today (with template calls). But we could use meta-templates because they would no longer hurt the servers. --Adrian Buehlmann 23:29, 17 January 2006 (UTC)
- That seems ridiculously complicated. It would become far too difficult for newbies to edit pages. --bainer (talk) 23:24, 17 January 2006 (UTC)
- My idea would be along the line: Have wiki source to edit (includes template calls). Save expands all templates, store result and build html from that. So templates would only be updated to an article per editor request. Hyper luxory substing.--Adrian Buehlmann 23:21, 17 January 2006 (UTC)
- So basically all that does is replace wikitext with a different language. Users would edit in 'wiki++', which would be compiled to wikitext, which upon first page request would be converted to HTML and cached. That buys us nothing at all. --DCrazy talk/contrib 23:15, 17 January 2006 (UTC)
- That shouldn't matter. Auto-substing should only happen on templates that need to be substed. Templates that don't get substed (or wouldn't benefit thereby) will remain as now. ] 23:35, 17 January 2006 (UTC)
- Yup, I know. Make a policy to only edit X/src? Or implement it in MediaWiki (a compile button!). --Adrian Buehlmann 23:13, 17 January 2006 (UTC)
- And then someone edits X and now X and X/src are out of sync. Recompiling X/src destroys X. --DCrazy talk/contrib 23:08, 17 January 2006 (UTC)
- I'm sure you could do this quite easily with a java application. (NB I don't write java) ] 22:32, 17 January 2006 (UTC)
- If a bot running around updating all subst'd templates is more efficient and better for the servers than an actual template, why not just modify templates to make them behave like a bot? — Omegatron 22:29, 17 January 2006 (UTC)
- Not really... see my article on the matter for why subst: doesn't cure all the ills inflicted by meta-templates. Bots that auto-subst are a great resource, but don't do everything necessary (unless someone were to write a bot that parsed the template and inserted its final, processed wikitext into the page). Still, it's a start. --DCrazy talk/contrib 21:03, 17 January 2006 (UTC)
- Well, it may not be a force-subst, but if you check Misplaced Pages:Subst we do have a bot that auto-substs selected templates. Radiant_>|< 17:59, 18 January 2006 (UTC)
- What I don't get is, if there is a bot, how can there be so many of the 'welcome' and 'test' type templates listed at WP:HRT? --CBD ☎ 18:02, 18 January 2006 (UTC)
- Probably because at the time HRT was written, those tls were still transcluded in many places (and at any rate, they're frequently used; a vandal could have a good laugh by messing up a test-template and it would be some time before the RC'ers might notice that their warning was off). WP:BEANS, I know. Radiant_>|< 18:10, 18 January 2006 (UTC)
- What I don't get is, if there is a bot, how can there be so many of the 'welcome' and 'test' type templates listed at WP:HRT? --CBD ☎ 18:02, 18 January 2006 (UTC)
Have a look at http://magnusmanske.de/wikipeerdia. This has the concept of stable versions. I suppose a stable version "freezes" a page and makes it immune against changes in transcluded templates. Looks very interesting (Although there's currently some bad error right now with that stable version thing). Stable versions also apply to templates, but I haven't yet figured out how that works. --Adrian Buehlmann 19:48, 20 January 2006 (UTC)
Policy status
In these two edits:
Brion makes it fairly clear that server issues shouldn't affect editors like this, and as well, seems to indicate that he doesn't buy the server load argument presented by Jamesday.
Until such time as the developers agree, this absolutely must not be considered policy (and should not be "enforced"). —Locke Cole • t • c 02:28, 21 January 2006 (UTC)
- I think you're reading into Brion's comments what you want them to say. I see him, especially in this comment, agreeing that there are several practical and technical reasons to avoid using nested templates, where one will work. WP:AUM is not built on any one factor... it is based on experience and precedent from WP:TFD, where we routinely vote to delete nested templates that are used in convoluted and impractical ways. Brion also does not comment on Jamesday's main complaint, about page caches becoming invalidated. There is also one other reason, that deeply-nested templates are rarely on more than a couple watchlists, making vandalism harder to watch for. -- Netoholic @ 02:54, 21 January 2006 (UTC)
- That's a circular argument. AFAIK the deletion of nested templates at TFD hit full swing when you unilaterally (and without community consensus) promoted this to policy (under the guise of "developer approval"). Clearly not all developers (let alone Brion!) agree this is an issue. Note Brion's response: If someone's advising against "metatemplates" because they're ugly, fragile, and likely to break, listen to them. If someone's advising against them because they "increase server load", ask them for their benchmarks. I'd love to see them.. And I agree, if the argument is that they're ugly/fragile/likely to break, I'd give it some consideration. However, as Brion says, if the argument is that they "increase server load", it's a non-starter right now. If this is so slam-dunk obvious, it's bothersome that someone like Brion wouldn't want to endorse AUM. (But at the same time, he seems willing to consider it if someone will show him benchmarks proving the claims made).
- Until these issues are resolved, and given the lack of community consensus in making this "policy", I strongly suggest keeping the policy tag off this page. I also suggest, as before, not "enforcing" this until the technical issues have been argued out. —Locke Cole • t • c 03:13, 21 January 2006 (UTC)
- I did not promote this to policy - three separate Arbitrators did that, and other members of the Committee have said they agree completely. So, if you think you're reverting me, you've got it wrong. I can re-write the page to balance the server load issues described by Jamesday with other concerns. This is still a fine policy. -- Netoholic @ 03:28, 21 January 2006 (UTC)
- This seems to address the server load issues, though. —Kirill Lokshin 03:39, 21 January 2006 (UTC)
- anyone got a link to the arbitrators statements? i seem to remember they basically bought into the interpretations based on that single vauge statement from jamesday and promoted this to policy based ont that alone. With that basically shot down by the lead developer '"Policy" shouldn't really concern itself with server load except in the most extreme of cases; keeping things tuned to provide what the user base needs is our job'. IF it is believed that this should still be policy (or perhaps just guideline) based on other reasons then imo it needs to be rewritten based on those other reasons alone and then decided on as a per new policy. Plugwash 03:48, 21 January 2006 (UTC)
- No links here, but IIRC it happened exactly as you described. Arbitrators bought into the argument (sans evidence) and were convinced to promote this to policy. I do think however that it was initially promoted by a non-arbitrator though... I'll have to go digging later. —Locke Cole • t • c 03:53, 21 January 2006 (UTC)
Developer statement
{moved from main page)
There's a lot of talk about this 'policy' which attempts to divine meaning from things other people have said rather than just asking for details.
Complicated templates-within-templates generally ought to be thought twice about before being used, because they can be confusing and fragile. There are some good notes about that on this page; please don't go all willy-nilly with illegible code just because it sort-of works.
There are other notes on this page about server performance which are not necessarily clear or well-supported. In particular, there's no known evidence that moderate usage of meta-templates has any noticeable impact on server performance.
While there are potential issues with cache invalidation, that's a separate issue which can be separately solved -- and is little better with "regular" templates.
I'd like to ask that anyone fighting against ugly, fragile meta templates at this time do so based on their ugliness and fragility. Please don't go around claiming "the developers" laid down the law and said nobody can use meta-templates because they hurt the servers; that just isn't true. --Brion 03:25, 21 January 2006 (UTC)
- i have restored this statement to the main page and imo it should stay there until such time as the process arround this is restarted from scratch based arround the other issues. If developers really need us to change something they have direct contact with jimbo and the board so it should be a non-issue for them to implement it through proper channels with official statements. lets do as brion suggests and stop self crippling based arround vauge statements from a single developer or guesses by users as to what causes server load. Plugwash 04:34, 21 January 2006 (UTC)
- Agreed. —Locke Cole • t • c 04:44, 21 January 2006 (UTC)
- Feel free to take it off once it's served its purpose, but I think this page desperately needs some rewrite lovin', so replace it with something appropriate... --Brion 04:52, 21 January 2006 (UTC)
- Thank you for your statements here. Though they have clarified some things, I think a lot of things are still heavily unclear. I have been forced by this policy and important wikipedians to work implement it (which I did working quite hard). I have started doing that by using the proposal of Netoholic, which has had his ArbCom ban lifted to push this to the "misguided masses". Now, could you please guide us? Abstract statements do not help here. We have ben said to be "wanna be" coders because we put up template:qif. Now we use the trick most favored by Netoholic as described in my doc. I agree that qif is ugly and I also agree that the CSS is ugly and I also agree that the weeble code trick is ugly. So which one shall we take? What shall we do with template:book reference? What with template:Infobox President and what with template:language? Your's puzzled and tired out, --Adrian Buehlmann 09:45, 21 January 2006 (UTC)
Alternatives to "logical" or "conditional" meta-templates
I really, really think we should push for support of one of the ideas presented here. This would likely make templates (such as Template:Language) easier to read, and perhaps even provide a way for MediaWiki to optimize page creation. I'm not sure how we'd handle other forms of meta-template use, but this would probably address the most offensive use to those concerned. —Locke Cole • t • c 05:41, 21 January 2006 (UTC)
- Another possibility (though the syntax is ugly IMO): m:User:AzaToth/Logic. —Locke Cole • t • c 07:50, 21 January 2006 (UTC)
Protected
We tried unprotection. Now we're back to an edit war. Work it out. --Woohookitty 07:41, 21 January 2006 (UTC)
- I'll unprotect. Might've been a bit hasty. --Woohookitty 08:00, 21 January 2006 (UTC)
Brion's comment
There's a lot of talk about this 'policy' which attempts to divine meaning from things other people have said rather than just asking for details.
Complicated templates-within-templates generally ought to be thought twice about before being used, because they can be confusing and fragile. There are some good notes about that on this page; please don't go all willy-nilly with illegible code just because it sort-of works.
There are other notes on this page about server performance which are not necessarily clear or well-supported. In particular, there's no known evidence that moderate usage of meta-templates has any noticeable impact on server performance.
While there are potential issues with cache invalidation, that's a separate issue which can be separately solved -- and is little better with "regular" templates.
I'd like to ask that anyone fighting against ugly, fragile meta templates at this time do so based on their ugliness and fragility. Please don't go around claiming "the developers" laid down the law and said nobody can use meta-templates because they hurt the servers; that just isn't true.
--Brion 03:25, 21 January 2006 (UTC)
General comments
It is worth noting that Brion continues to condemn meta-templates for being ugly and fragile - which they are - and falls miles short of endorsing them. It is questionable whether "should policy be crafted to reduce server strain" is something that falls within the realm of things the developers get to set automatically for us. It remains the case that Jamesday has said what he has said, and he did say to depricate qif, not start using more meta-templates, and that meta-templates cause noticable server load.
Since depricating the meta-templates we have has been COMPLETELY HELLISH, until this actually gets sorted out so that the developers are on the same page, since meta-templates do not add any functionality that can't be achieved other ways, since they are messy, since they are fragile, and since there remains a fair chance that they're a significant server problem, we still should not be using them, because we are sensible people who like playing it safe when it comes to asking if we should make big messes that take days to clean up. And when Brion and Jamesday present a unified answer, we can deal with that. But until then, we have clear comments from the lead database admin, and questions about whether that's the best reason to kill meta-templates, or whether they should just be killed for more superficial reasons from Brion. This is not grounds to add a giant box to the top of the page, and it is especially not grounds to start using meta-templates actively again. In fact, doing so would be SUPREMELY stupid, since there are clear alternatives. Phil Sandifer 17:53, 21 January 2006 (UTC)
- Those 'clear alternatives' are equally 'ugly and fragile'... and not all that clear. Which is a good portion of why the efforts to force them through have been 'completely hellish'. That said, stopping all activity and getting some real/complete answers before proceeding makes sense... and would have a month ago too. --CBD ☎ 18:09, 21 January 2006 (UTC)
- I put a box on the page because there's been a lot of hysteria based on the false belief that there is an order from on high; just a quick skim of this gigantic talk page will show you that. I'd rather see this defused, and have people think for themselves and use some common sense. --Brion 18:10, 21 January 2006 (UTC)
- Yes. Unfortunately, I suspect in practice you set off edit wars on about two dozen pages, 23 of which will be high-profile templates. Phil Sandifer 18:35, 21 January 2006 (UTC)
- Agreed. Without some very clear, incontrovertible statements in a very visible place about what is allowed and what is not, the edit wars will continue and probably get even worse. These people will try to minimize your comments and do anything they can to misinterpret them in their favor.
- The "ugliness and fragileness" will become the next bloody battleground. We need some clear direction here. The box was a good thing. — Omegatron 19:31, 21 January 2006 (UTC)
- In my opinion, it's the most important reason. It's the main reason I cite when I ask for meta-templates to be removed. Where they're unnecessary ({{Main}} is an obvious example), they shouldn't be used because their effect can be achieved so much more easily in another way. ] 19:53, 21 January 2006 (UTC)
- How is that a meta-template??
- Other than server load, what's wrong with it? — Omegatron 20:19, 21 January 2006 (UTC)
- Several things, off the top of my head. First, it's using a CSS hack to hide structure elements, which can fail for text browsers, plaintext renderings of articles, and any HTML display of the article that doesn't use the stylesheet on this site. This harms both the primary site's accessibility and offsite reuse of material. Second, as you can see its source is simply very ugly; it would benefit from a conditional or array construct. --Brion 20:28, 21 January 2006 (UTC)
- What Brion said. Apart from that, it's really an unnecessary template. How hard is it to write a one line message to get the point across? It will almost always be more useful to the reader. ] 20:30, 21 January 2006 (UTC)
- Um... let me just see if I understand this right Sam. You agree with what Brion said? That the current non meta version of Template:Main is very ugly, that it is harmful to accessibility and reuse due to the CSS hack method, and that it would benefit from a 'conditional or array construct'... which traditionally has been accomplished using meta-templating. So, would it be better to go back to the meta version? Or implement a 'weeble' variant? --CBD ☎ 20:47, 21 January 2006 (UTC)
- Once again, thank you for pointing this out. This is actually a bad example, because it shouldn't really be a template at all. As it is, I guess I'm not really that opposed to some simple additions to the code, so long as they are simple. I don't see the need for anything more than if/elseif/else. ] 20:55, 21 January 2006 (UTC)
- So you agree that the CSS hack is bad? Me too.
- Why do you say it shouldn't be a template at all? — Omegatron 21:48, 21 January 2006 (UTC)
- {(Main}} is the perfect example of a template which is ridiculously over-thought. It shouldn't use meta-templates, it should not have to use CSS... It should be changed to work exactly like Template:Further - that is, to take exactly one paramter, and let people put howevermany and whateverdamn wikilinks they want. -- Netoholic @ 05:45, 22 January 2006 (UTC)
- What is it hurting? — Omegatron 05:51, 22 January 2006 (UTC)
- Have you read this thread? {(Main}} uses complex code (whether CSS or meta-template) where none is needed because the function can be done without any of that. -- Netoholic @ 12:41, 22 January 2006 (UTC)
- What is it hurting? — Omegatron 05:51, 22 January 2006 (UTC)
- {(Main}} is the perfect example of a template which is ridiculously over-thought. It shouldn't use meta-templates, it should not have to use CSS... It should be changed to work exactly like Template:Further - that is, to take exactly one paramter, and let people put howevermany and whateverdamn wikilinks they want. -- Netoholic @ 05:45, 22 January 2006 (UTC)
- Once again, thank you for pointing this out. This is actually a bad example, because it shouldn't really be a template at all. As it is, I guess I'm not really that opposed to some simple additions to the code, so long as they are simple. I don't see the need for anything more than if/elseif/else. ] 20:55, 21 January 2006 (UTC)
- Um... let me just see if I understand this right Sam. You agree with what Brion said? That the current non meta version of Template:Main is very ugly, that it is harmful to accessibility and reuse due to the CSS hack method, and that it would benefit from a 'conditional or array construct'... which traditionally has been accomplished using meta-templating. So, would it be better to go back to the meta version? Or implement a 'weeble' variant? --CBD ☎ 20:47, 21 January 2006 (UTC)
- In my opinion, it's the most important reason. It's the main reason I cite when I ask for meta-templates to be removed. Where they're unnecessary ({{Main}} is an obvious example), they shouldn't be used because their effect can be achieved so much more easily in another way. ] 19:53, 21 January 2006 (UTC)
- Yes. Unfortunately, I suspect in practice you set off edit wars on about two dozen pages, 23 of which will be high-profile templates. Phil Sandifer 18:35, 21 January 2006 (UTC)
What I need from you
What I'm going to need from you guys is some feedback on what is and isn't needed/wanted. In particular:
- Conditional "if"-like constructs can be very easily done in the software, and should be more reliable than wacky template tricks. What other constructs are needed that don't boil down to a conditional include?
- Are there any genuinely useful constructs that would break if we limited the depth of includes to, say, two levels of templates? (Article -> Template1 -> Template2)
- We're never going to turn templating into a full-fledged programming language, but template constructs can sometimes benefit from array-like data where each item is processed identically. What are some examples of attempts to do this, and how could we more cleanly replace them?
Keep in mind that clean, legible use at the article source text level should be paramount. Scary complex templates can be quite intimidating for non-technical editors -- and even for highly technical editors who aren't familiar with a given 'extreme' template. At some point in the future we're likely to move towards more WYSIWYG-style editing as well, so minimizing complex 'magic' is good future-proofing. -- Brion 20:23, 21 January 2006 (UTC)
- legible use at the article source text level should be paramount. Scary complex templates can be quite intimidating for non-technical editors
- This could be rephrased as "complex template source is preferable to complex article source", right? If a template is easier for non-technical editors to use in articles, this is preferable, even if the template source code is more difficult to edit. — Omegatron 20:29, 21 January 2006 (UTC)
- Clear article source and clear template source are most preferred! If you must make one or the other ugly, an ugly template source is better than ugly article source, since the template code will be edited more rarely and by fewer, probably more technical, people. Don't consider that a license to be unnecessarily ugly, though. :) --Brion 20:33, 21 January 2006 (UTC)
- That's exactly what I meant. Some are interpreting this to mean that complicated markup should be put into the article source instead of the template source, because server load is more important than editability of articles, which seems obviously wrong to me. — Omegatron 21:51, 21 January 2006 (UTC)
- Out of curiosity, is that WYSIWYG style of editing going to be like WordPerfect, with a "reveal codes" function? If so, I think that would be an exceptional way of doing things. ] 20:36, 21 January 2006 (UTC)
- Brion, that's really great. I think the minimum set we need is:
- A string expression function "if". It takes two string parameters S1 and S2. The resulting value should be S2 if S1 is non-empty, the empty string otherwise. I do not care about syntax and name of the function.
- An expression function "not" with one parameter S. Returns a non-empty string if S is empty, the empty string otherwise.
- An expression function "or" with two parameters S1 and S2. Returns a non-empty string if S1 or S2 are non-empty.
- An expression function "and" with two parameters S1 and S2. Returns a non-empty string if S1 and S2 are non-empty.
- The functions should be able to be nested. If needed we can limit the levels of if's. I have not seen more than an if inside an if. So I would set a limit to four levels (if needed).
- article -> template1 -> template2 sounds reasonable to me, especially if we have built-in conditionals. --Adrian Buehlmann 21:18, 21 January 2006 (UTC)
- Just a sidenote: dbenbenn brought up the idea to strip <span class="hiddenStructure"></span> with MediaWiki from the html source (extending tidy). Maybe this could be used as a fast intermediate step? At least it would produce decent html without any syntax change. --Adrian Buehlmann 23:04, 21 January 2006 (UTC)
- That would be possible, but it's a rather slow procedure, so if implementing it's better to implement a faster construct instead. →AzaToth 23:08, 21 January 2006 (UTC)
- You're right. --Adrian Buehlmann 23:10, 21 January 2006 (UTC)
- That would be possible, but it's a rather slow procedure, so if implementing it's better to implement a faster construct instead. →AzaToth 23:08, 21 January 2006 (UTC)
- Just a sidenote: dbenbenn brought up the idea to strip <span class="hiddenStructure"></span> with MediaWiki from the html source (extending tidy). Maybe this could be used as a fast intermediate step? At least it would produce decent html without any syntax change. --Adrian Buehlmann 23:04, 21 January 2006 (UTC)
- Ehh, this is like logic gates; you don't even need all that. Or can be implemented simply by concatenating the strings (i.e. {{if|{{{par1|}}}{{{par2|}}}|result}}. And is similarly implementable by using a combination of nots around an if.
- Strictly speaking, though, 99% of the current uses could be implemented with a simple if. —Kirill Lokshin 22:40, 21 January 2006 (UTC)
- Well, yes and no. We already have a 'simple if' feature based on the 'blank parameter' trick. An example of this can be seen at Template:Language/familycolor. Because an empty parameter ('|if=') is passed in we can evaluate to see which other parameter exists and only display results for that one... a switch built on a simple 'if exists'. That can be used to replace pretty much every meta-template we have currently... but people have been very resistant to doing so. Largely because it involves changing existing template calls (as any new conditional implementation presumably would as well). However, it is also just a long way to go to get some results... for instance, you can do a 'not' condition if you have some parameter which is always passed by using {{{if{{{requ{{{optional|}}}ired|}}}|Text to display if 'required' parameter exists and 'optional' parameter does not}}}... but if you don't have any parameters which are always required for that template there's no way to do a 'not'. Likewise, the 'switch' example above has to perform the 'if' logic over and over again. You can do most things with a 'simple if', but we've already got that and while possible it isn't always easy/pretty. --CBD ☎ 23:36, 21 January 2006 (UTC)
I made an example implementation for some extended syntax at m:User:AzaToth/Logic. My primary objective was to make a fast parser with monomal overhead. If none of the extended constructs are used the only overhead is a simple strpos. Othervise is rather simple in it's parsing, it just split the string and run it throught a switch statement. My reason to use a different syntax than ordinary wiki syntax is becaus then I can ignore the semantic of the wikicode and use the extended syntax as a preparser. I tried to create "functions" that are usefull for a wiki, the map-construct I made for the purpouse for use in for example Template:main. →AzaToth 20:44, 21 January 2006 (UTC)
- I think AzaToth's implementation ideas above would make it possible to do virtually anything we currently do (and some things we don't) with a single template level (Article > Template). That said, even if it were possible to do everything with one level of transclusion (and no CSS hack or blank parameter trick) I'd think we would want to keep at least a few deeper levels available... even if they are not 'needed' they are still 'useful'. Without deeper transclusion levels the template functionality would have to be 'cloned' for each new template rather than just calling an existing template. Things like Template:clear could be used in articles, but not in other templates. That's a simplistic (and largely unneccessary) example, but the concept extends to all sorts of formatting/utility templates. The contents of Template:Oh My Goddess Infobox-Generic/Text could just be written out each time, but making it a template allows it to be called multiple times by two different templates... simplifying the template instruction code considerably while keeping the format consistent. Et cetera. Not required. Same capabilities can be done without the second/third/et cetera template layers, but it is often 'easier' / 'prettier' if you use sub-templates. --CBD ☎ 21:28, 21 January 2006 (UTC)
- Agreed. It's good to use a simple formatting/heavy markup/functionality template inside another to keep all the related templates consistent and easy to edit. Just like you would use include statements to put standard libraries in a bit of source code instead of typing all the standard functions in by hand, or use functions to perform the same operation over and over instead of retyping it manually each time.
- It removes the "maintenance nightmare" of editing each template manually to change their style or fix a browser-specific problem with the markup, for instance.
- We can certainly do without it, but it's tremendously useful if we can afford it. — Omegatron 21:59, 21 January 2006 (UTC)
- On the subject of levels of includes: is there any distinction in MediaWiki between template transclusion and transclusion of pages from other namespaces. For instance, if we limit nesting to two levels, will Misplaced Pages: and Portal: space constructs like project page → project subpage → template1 → template2 fail? —Kirill Lokshin 22:57, 21 January 2006 (UTC)
- All transclusion is treated the same. --Brion 23:31, 21 January 2006 (UTC)
"Are there any genuinely useful constructs that would break if we limited the depth of includes to, say, two levels of templates?" Hm. Template:USA uses Template:Country uses Template:Country flagcountry uses Template:Country flag alias USA, Template:Country alias USA, and Template:Country shortname alias USA. You could easily cut that down to 2 levels, by substing in Template:Country then in Template:USA. Anyway, that's the deepest level of nesting I could think of off hand. dbenbenn | talk 23:22, 21 January 2006 (UTC)
Simplest possible codeset
Unless I'm completely mistaken, the simplest possible set of options we need are:
- the equivalent of
{{qif}}
, a simple IF…THEN…ELSE implementation (which could even be implemented by hard-wiring the contents of{{qif}}
into the transcluder) which supplies the contents of the "then" parameter iff the "test" parameter is a non-blank string, and the "else" parameter otherwise:
{{#if | test = | then = | else = }}
- the equivalent of {{switch}}, a simple CASE…SELECT…DEFAULT implementation (which could even be implemented by hard-wiring the contents of
{{switch}}
into the transcluder) which chooses a parameter based on the first parameter, with a default:
{{#switch | test-string | case: foo = | case: bar = | default = }}
- the equivalent of {{booleq}} which supplies the string(s) being tested if they are equal, and a blank string otherwise:
{{#equal | test-string-1 | test-string-2 }}
I'm suggesting using the {{#… construct because AFAIK this is not a legal name for a template (if I attempt to transclude {{#if}} it fails as you can see), so it wouldn't break anything already in place and it could easily be intercepted.
I think that this fulfils the requirements for the simplest possible set of constructs which would be useful, whilst avoiding the risk of becoming Turing-complete which I believe is what has some developers worried (and rightly so).
I'm not certain that we need anything that "don't boil down to a conditional include", and I'm actually having a hard time imaging any such thing :-). As for looping constructs, I'm not convinced that these wouldn't become a handy vector for some sort of DOS attack. HTH HAND —Phil | Talk 08:33, 23 January 2006 (UTC)
- This is a very good proposal which I fully support. Thank you Phil. As for the simplicity and ease of reading of template code I would propose, if possible, to add logical functions as "not" "or" and "and" at least. These can be mimicked if we have that qif (but needs the "else" capability with empty "then" part, which is not supported by the actual qif hack template), but that leads again to unreadable template code. --Adrian Buehlmann 08:47, 23 January 2006 (UTC)
- I also support this. —Locke Cole • t • c 12:22, 23 January 2006 (UTC)
I do not support any proposal to add conditionals. People are over-thinking how templates are used, and I can describe, for any potential usage of conditionals, options which are easier on both template geeks and editors. I challenge anyone to come up with something that actually requires conditionals. -- Netoholic @ 12:18, 23 January 2006 (UTC)
- Uhm, an infobox which wants to allow optional parameters. —Locke Cole • t • c 12:20, 23 January 2006 (UTC)
Policy/Guideline status
I think we need to edit this down a bit before we slap {{guideline}} on it. Specifically, the section titled "Use of meta-templates" likely needs to be totally rewritten in light of the dispute over server effect/load. I propose we work on a rewrite at Misplaced Pages:Avoid using meta-templates/Temp, then move that in place once we're in agreement (and then place {{guideline}} back on it). —Locke Cole • t • c 00:54, 22 January 2006 (UTC)
- Do we even need this page? If the server load issue isn't really an issue, then this page should have a {{historical}} tag. That's the only reason it existed in the first place.
- The parts that are still applicable can go to Help:Template or How to use templates efficiently or something like that. — Omegatron 01:25, 22 January 2006 (UTC)
- I think we can all agree that overly complex meta-templates (be it complexity from multiple levels, or complexity from nesting calls to templates within other templates) should be avoided (emphasis there, not outlawed, not banned, not disallowed, but avoided). I just think the language in use now leans too much in favor of zero-tolerance for meta-templates. Certainly if there's agreement though we could place {{historical}} on it. But we should probably wait for Jamesday to have a chance to respond with the information Brion requested. —Locke Cole • t • c 01:34, 22 January 2006 (UTC)
- I've taken what's on the main page now, hacked off a good chunk of it, and started a rewrite at Misplaced Pages:Avoid using meta-templates/Temp. (I've also redirected the talk page there back here). Feel free to discuss changes or edit as you see fit (we can discuss any issues that crop up as we go). —Locke Cole • t • c 09:51, 22 January 2006 (UTC)
- I think we should stop fiddle around with this page until we know more from Brion. Ugliness and fragility is not that helpful as a guideline. The policy tag is gone and I'm also happy with the removal of the guideline tag. I think that's it for the moment. If we edit here too much we just end in another useless content dispute. The comments about meta-templates from Brion and his expression to implementent conditionals in MediaWiki speek for itself. These are the most important two things. --Adrian Buehlmann 10:18, 22 January 2006 (UTC)
- I'm not comfortable with that. Brion is a paid developer. He's paid to make Wikimedia work well. Of course he is going to defend how well Wikimedia is working because anything else reflects on him. Jamesday is a database developer and knows full well how "costly" database reads are over other operations. Both agree that we should reduce template calls where necessary. The developers are not disagreeing - Jamesday describes the theory behind it all, and he's right. Brion wants to be shown proof that Misplaced Pages is actually being affected, and he's right. Both are in total agreement that complex code should be avoided for the editor's sake. This page is just one more guideline for good use of templates. -- Netoholic @ 12:25, 23 January 2006 (UTC)