this post was submitted on 31 Jul 2024
739 points (99.3% liked)
Programmer Humor
19488 readers
1012 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
- Keep content in english
- No advertisements
- Posts must be related to programming or programmer topics
founded 1 year ago
MODERATORS
you are viewing a single comment's thread
view the rest of the comments
view the rest of the comments
If you think
is-number
can be replaced with a one-liner, you don't have the enterprise code mindset. What if the world gets more inclusive and MMXXIV, ½ and ⠼⠁ become recognized as numbers? 𒐍𓆾 were numbers in the past but what if people start assigning numeric value to other characters? Are 🖐🔟💯🆢🂵🀌🁅 numbers of the future???/s
I'm not even all kidding, Regex implementations are split on whether "٣" matches
\d
.It's simple ⅯⅯⅩⅩⅣis a number, MMXXIV is not.
You may argue that writiing 2024 as "
MMXXIV
" and not "ⅯⅯⅩⅩⅣ
" is a mistake but while typists who'd use "2OlO
" for "2010
" (because they grew up using cost-reduced typewriters) are dying out, you'll never get everyone to use the appropriate Unicode for Roman numerals.Wouldn't surprise me if even Unicode advices against using Roman numerals depending on meaning.
It was mostly a joke (though frankly if you try any implementation more complicated than that joke you're going to have a bad time).