this post was submitted on 27 Dec 2023
36 points (100.0% liked)

Programming Horror

22 readers
1 users here now

Welcome to Programming Horror!

This is a place to share strange or terrible code you come across.

For more general memes about programming there's also Programmer Humor.

Looking for mods. If youre interested in moderating the community feel free to dm @Ategon@programming.dev

Rules

Credits

founded 1 year ago
MODERATORS
 

Jesus Christ, just add an if statement for even or odd!

top 5 comments
sorted by: hot top controversial new old
[–] onlinepersona@programming.dev 9 points 9 months ago (1 children)
[–] Aatube@kbin.social 5 points 9 months ago (1 children)

https://en.wikipedia.org/wiki/Template:Signpost/item, if that's what you mean.
The JPxG person (who is not an employee of WMF for some reason; maybe they didn't apply?) recently put this in the testing version of the template:


{{#switch: {{{2}}}
  | 0 =        {{#switch: {{{1}}}
                 | 3 = <div><span>''{{{4}}}'' — ''[[#{{{4}}}|{{{5}}}]]''</span></div>
                 }}
  | #default = {{#switch: {{{1}}}{{#expr:{{{2}}} mod 2}}
                 | 10  =
                 | 11  =
                 | 20  =
                 | 21  =
                 | 30  = <div><span>{{{4}}}</span><br>[[#{{{4}}}|{{{5}}}]]</div>
                 | 31  = <div><span>{{{4}}}</span><br>[[#{{{4}}}|{{{5}}}]]</div>
                 | 40  =
                 | 41  =
                 }}
}}

maybe he was rejected because of his awful date format?

Anyway, the testing version has now been automatically protected from editing because JPxG also tested his kewl new testing version by using it in an old 2010 issue, which resulted in 827 page updates

[–] onlinepersona@programming.dev 1 points 9 months ago (1 children)

For all the good wikipedia does, it has the worst markup language I've seen.

CC BY-NC-SA 4.0

[–] Aatube@kbin.social 2 points 9 months ago

I mean, it's very OK and even charming when you have https://www.mediawiki.org/wiki/Extension:ParserFunctions enabled. You can perfectly read the testing version of the code, no?

[–] NerdyPopRocks@programming.dev 1 points 9 months ago

But does it work? XD