this post was submitted on 31 Jul 2024
741 points (99.3% liked)

Programmer Humor

19706 readers
164 users here now

Welcome to Programmer Humor!

This is a place where you can post jokes, memes, humor, etc. related to programming!

For sharing awful code theres also Programming Horror.

Rules

founded 1 year ago
MODERATORS
 
you are viewing a single comment's thread
view the rest of the comments
[โ€“] [email protected] 28 points 3 months ago* (last edited 3 months ago) (8 children)

So the only valid digits are arabic numbers but arabic script numbers are not a valid digit?

Some people writing Regex implementations have that opinion. I've refrained from saying mine.

If we want programming to be inclusive then doesn't that make sense to also include the arabic script number?

Maybe. IMO, number tests should be chosen/implemented based on the project's requirements. If you want to include every Unicode character or string pattern anyone's ever used to convey a numeric value, that would be a long and growing list. Arguably, it's impossible: the word "elf" means a number if interpreted as German for "eleven" but not if interpreted as English for ๐Ÿง.

[โ€“] bitfucker 7 points 3 months ago (7 children)

Yeah, but "elf" are not digits. Digits are a symbol abstracted from the language itself. Does 5 and V convey different meanings in the context of digits? And yeah, I can see why they would argue about the implementation because inclusivity is important. Especially when designing a language implementation. If you are designing it wrong, it will be very hard to extend it in the future. But for application level implementation, go nuts.

[โ€“] [email protected] 3 points 3 months ago* (last edited 3 months ago) (1 children)

But elf=B=11. Kinda depends on context if 11 is a digit

[โ€“] bitfucker 2 points 3 months ago

As I said, a digit is a symbol. Much like how we use letters to compose words, digits are used to construct numbers. When you start to repeat or reuse the symbol then it is no longer a singular symbol (what regex \d does). Hence my comments on why arabic script are one of the understandable debates since i18n is a valid concern as much as a11y is.

load more comments (5 replies)
load more comments (5 replies)