News for hackers. Stuff that matters.
Re:It's Not Wrong that " ".length == 7 by jibal on Friday August 22, 2025 @05:44AM (#44982600)
The point is that those terms are ambiguous ... and if you mean the length in grapheme clusters, it can be quite expensive to calculate it, and isn't the right number if you're dealing with strings as objects that are chunks of memory.
Re:It's Not Wrong that " ".length == 7 by zwnow on Friday August 22, 2025 @06:36AM (#44982873)
Miss me with that nerd shit, I just want to check whether a user input matches validation rules and I won't count the bytes for that.
Re:It's Not Wrong that " ".length == 7 by dwb on Friday August 22, 2025 @07:35AM (#44983247)
You are in the wrong job if you don’t want to think about “nerd shit” while programming.
Re:It's Not Wrong that " ".length == 7 by zwnow on Friday August 22, 2025 @08:48AM (#44983960)
Idk it pays my bills and I have success at work so I must do something right.
Re:It's Not Wrong that " ".length == 7 by dwb on Friday August 22, 2025 @10:20AM (#44985035)
Well I just hope I don’t have to use any of the software you build. What a shameful attitude.
Re:It's Not Wrong that " ".length == 7 by zwnow on Friday August 22, 2025 @10:55AM (#44985399)
The whole industry is shameful considering devs regularly build software like Palantir. Its all about paying your bills and I hope you too will realize that at some point.
Re:It's Not Wrong that " ".length == 7 by dwb on Friday August 22, 2025 @12:06PM (#44986247)
I agree about Palantir but that’s a big deflection. And don’t patronise me. Paying your bills and paying enough attention to technical details to write good programs are in no way mutually exclusive.
Re:It's Not Wrong that " ".length == 7 by jibal on Thursday August 28, 2025 @11:42AM (#45053613)
Posting "Miss me with that nerd shit" in this thread certainly isn't doing anything right.
Re:It's Not Wrong that " ".length == 7 by tomsmeding on Friday August 22, 2025 @09:13AM (#44984265)
If the validation rules don't specify (either explicitly or implicitly) what the "length" in the rule corresponds to (if it concerns a natural-language field, it's probably grapheme clusters), then either you should fix the rule, or you care only about checking the box of "I checked the validation rules", in which case it's a people problem and not a technology problem.
Re:It's Not Wrong that " ".length == 7 by zahlman on Friday August 22, 2025 @02:42PM (#44988201)
It is not possible to write correct code without understanding what you dismiss here.