Template talk:PeopleDecadebyCountry

From Wikimedia Commons, the free media repository
Jump to navigation Jump to search

Noinclude tags

[edit]

Is there a purpose to all these noinclude tags added in this version @Verdy p: ? All it seems to do is make the markup much more complicated to review and added a confusing and misleading example with the United States on the template page. Template:PeopleYearbyCountry has a documentation subpage while Template:PeopleCenturybyCountry is not as complicated. -- Ricky81682 (talk) 23:38, 25 January 2022 (UTC)[reply]

That is made for instant preview when editing, before changes: this allows testing inside the page and has absolutely no measurable cost when the template is used (the code is loaded once, is cached after instant removal of noincludes, and the template can be reused many times, including from other pages directly from the cache).
Editing the template is in fact simpler as it is tested immediately before submitting, and we can validate the result for an examplar covering case. The code page of course can provide other tests and results.
I thin it is always a better idea to see the effect of and edit before sumitting, instead of fixing it later when we detect subtle bugs: these tests for broken cases can be made in the code itself, we are not limited to the number of previews we can make before submitting. Then we cand more completely make the first test case in the doc page (or accesory pages), given we have explored more coverage already). During theses preview steps, no other page are affected, this minimizes the global impact that could be caused by rendering all other pages multiple times (with huge costs when the template is used very often, which is also the case where the effect of caches is maximal and completely removes the costs of these noincludes).
That was from experience: much less problems with other users, especially for complex templates with many use cases. (the complex cases are for computing years/decades/centuries and converting them to suitable links or category names or to ordinals: previously the code was incorrect and broke inside the expected use ranges for some values, e.g. start of centuries or decenials).
Note that autocategorization is made visible in the preview (using "lrm" markers between the leading brackets, so that they are rendered litterally, at end of the result and do not generate categorization of the template page itself).
Note that It took care to keeping these tests consistant, and still correctly indented where it was safe): performance statistics were also monitored in the preview (they are logged in the generated HTML comments, we can see them in developer tools in the browser, in a dedicated section of the HTML "content" part that you can locate at the bottom of the content part). verdy_p (talk) 00:00, 26 January 2022 (UTC)[reply]
@Verdy p: Alright, whatever. I find it utterly confusing as hell to manage through but it works for you I guess. It took almost an hour for me to realize that the template already covered continent for country by decade 1, 2, and 3 versus reviewing and making this and this edit. To me, there is no fundamental reason that decades is so much more difficult to parse than years or centuries and those two require consistency just as much. -- Ricky81682 (talk) 04:42, 28 January 2022 (UTC)[reply]
@Ricky81682: For your convenience, I added the doc page that was forgotten. Note that decades are in fact simpler than centuries: decodes simply start on multiples of 10, while centuries start on multiple of 100 plus one (that's why the 3rd parameter, which was sometimes incorrect, is now infered). As well the visual formatting of decades and centuries is highly language-dependant (and this template is full internationalized to comply with it, using other shared utility subtemplates already used elsewhere). verdy_p (talk) 15:39, 28 January 2022 (UTC)[reply]