News for hackers. Stuff that matters.
Re:It's Not Wrong that " ".length == 7 by setr on Friday August 22, 2025 @05:00AM (#44982338)
I’m fairly positive the answer is trivially logical equivalence for pretty much any substring operation. I can’t imagine bitwise equivalence to ever be the “normal” use case, except to the implementer looking at it as a simpler/faster operation

I feel like if you’re looking for bitwise equivalence or similar, you should have to cast to some kind of byte array and access the corresponding operations accordingly

Re:It's Not Wrong that " ".length == 7 by arcticbull on Friday August 22, 2025 @05:04AM (#44982361)
Yep for a substring against its parent or other substrings of the same parent that’s definitely true, but I think this question generalizes because the case where you’re comparing strings solely within themselves is an optimization path for the more general. I’m just thinking out loud.