Since this isn't explicitly codified anywhere, and was sparked by discussion surrounding my recent challenge, I figured I'd bring it up here for consensus before modifying the tag.
Related:
- string
- What's a string?
- What are string literals?
- Things to avoid when writing challenges: Adding unnecessary fluff
The Question
When a challenge asks for a string, what should the default case-sensitivity be?
1 Answer 1
Unless specified otherwise, strings are case-sensitive. More generally, unless specified otherwise, strings are just sequences of characters with no semantics attached to any specific characters.
This should also be the least surprising default for users who are not aware of this post.
I'd also urge challenge authors to think twice before making a challenge case-insensitive. We've done case insensitivity more than often enough, and most of the time it's a concern that's completely orthogonal to the actual task of the challenge, and it just adds extra code for handling the case-insensitivity which adds nothing at all to the answers. Related reading.
-
3\$\begingroup\$ This answer hits the nail on the head. If you think about strings as sequence of bytes in a particular encoding, case-insensitivity makes no sense. While whether or not
"A" == "a"could be questioned, no reasonable person would think0x41 == 0x61. \$\endgroup\$user45941– user459412016年07月02日 00:01:51 +00:00Commented Jul 2, 2016 at 0:01 -
\$\begingroup\$ May you bold the "it just adds extra code" so at a glance it's clear what your stance is on this? \$\endgroup\$Downgoat– Downgoat2016年07月08日 03:33:37 +00:00Commented Jul 8, 2016 at 3:33