[05-25-2019]

Post a reply


This question is a means of preventing automated form submissions by spambots.
Smilies
:D :) :( :o :shock: :? 8) :lol: :x :P :oops: :cry: :evil: :twisted: :roll: :wink: :?: :idea: :| (o~o) :geek: :[] :geek2: :][>:=~+:

BBCode is ON
[img] is ON
[flash] is OFF
[url] is ON
Smilies are ON

Topic review
   

Expand view Topic review: [05-25-2019]

Re: [05-25-2019]

by AlixeTiir » Tue May 28, 2019 8:10 am

NeatNit wrote:To be honest, as a programmer, code for choosing the correct ordinal suffix is one of the most annoying things to write. It's not particularly difficult or anything like that, it's just a lot of ugly if statements. And needles to say, it's language-dependant (i.e. English only), so if you're making a program that supports multiple languages it can get a lot messier.

Just look at the rules for it in plain English (in the order I find intuitive, not in the order they would appear in code):
1. If the last digit is 1, it's "st".
2. If the last digit is 2, it's "nd".
3. if the last digit is 3, it's "rd".
4. If the last digit is anything else, it's "th".
5. If the second-to-last digit is 1, it's "th" even if the last digit is 1, 2 or 3.

It's just gross. The code would be full of magic numbers (and strings for that matter), and requires a ridiculous amount of code and edge case compared to the relatively trivial goal - just two lousy letters.
sounds like it would be much easier if we all switched to the number neutral ordinal suffix I just invented now: "xd"

Re: [05-25-2019]

by NeatNit » Sun May 26, 2019 8:59 pm

To be honest, as a programmer, code for choosing the correct ordinal suffix is one of the most annoying things to write. It's not particularly difficult or anything like that, it's just a lot of ugly if statements. And needles to say, it's language-dependant (i.e. English only), so if you're making a program that supports multiple languages it can get a lot messier.

Just look at the rules for it in plain English (in the order I find intuitive, not in the order they would appear in code):
1. If the last digit is 1, it's "st".
2. If the last digit is 2, it's "nd".
3. if the last digit is 3, it's "rd".
4. If the last digit is anything else, it's "th".
5. If the second-to-last digit is 1, it's "th" even if the last digit is 1, 2 or 3.

It's just gross. The code would be full of magic numbers (and strings for that matter), and requires a ridiculous amount of code and edge case compared to the relatively trivial goal - just two lousy letters.

Re: [05-25-2019]

by AlixeTiir » Sun May 26, 2019 6:47 pm

Christina wrote:The programmer must not have foreseen figures above 20, so he must have placed "st" for 1, "nd" for 2, "rd" for 3, and "th" elsewhere.
that's the most depressing developer oversight I have ever seen. And I've played games from Bethesda Softworks.

Re: [05-25-2019]

by Christina » Sun May 26, 2019 9:50 am

That's a bug in the programming. The programmer must not have foreseen figures above 20, so he must have placed "st" for 1, "nd" for 2, "rd" for 3, and "th" elsewhere.

[05-25-2019]

by AlixeTiir » Sat May 25, 2019 8:22 pm

Image

Don't you mean 4,291st?

Top