r/programminghorror • u/PEAceDeath1425 • Feb 11 '26
Java Thats technically correct...
Keep it simple, stupid!
796
Upvotes
r/programminghorror • u/PEAceDeath1425 • Feb 11 '26
Keep it simple, stupid!
192
u/PEAceDeath1425 Feb 11 '26
UPD: The PR was actually just approved, so this is a part of production code now
13
u/Luxy2008 Feb 12 '26
sorry for the stupid question but why is there a function to getUserNameWithBadWords? what's the usage of this
10
u/Ksorkrax Feb 11 '26
Automatically makes me wonder whether they do it the proper way (using it as mere suspicion base that has to be verified by a human) or the wrong way (invoking the Scunthorpe Prolem).
5
u/GoddammitDontShootMe [ $[ $RANDOM % 6 ] == 0 ] && rm -rf / || echo "You live" Feb 12 '26
So why is getting the
badWordsListso complicated? What doesgetAllRestrictionNamesList()return?4
u/Giddius Feb 12 '26
return 'Scunthorpe'223
u/Scharrack Feb 11 '26
Looks like a candidate for an "hack for presentation, fix afterwards" annotation from years ago nobody ever had time to fix.
150
u/v_maria Feb 11 '26
Average Yandex project
86
u/current_thread Feb 11 '26
It's also bad if you randomly sample from the list, cause that way you get flaky tests.
16
u/Zombiesalad1337 Feb 12 '26
While messing around with profanity filters on various online games, I've observed that most can easily be bypassed by concatening the same word twice. Eg. n#$ger would trigger the filter, n#$ern#$ger won't.
1
u/lazernanes Feb 14 '26
You poor thing, turning the list into a stream and then collecting it into a list. If only you could use kotlin.
6
u/HuntingKingYT Feb 11 '26
Why call me stupid😥 such a bad word
2
u/morrisdev Feb 23 '26
About 10yrs ago I was in the room as my "boss" explained that we needed to include a lookup table for equipment that didn't pass my personal word filter. The particular one was a n*ggr-lip, which I guess is some kind of tool that you use to hold back high voltage cable. He insisted that we had to have a lookup table so people searching for certain equipment by the "unapproved" word could find it.
The argument was just absolutely bonkers. But, I billed them $120/hr to just stand there and listen
1
u/P3JQ10 Feb 14 '26
It also makes the testing data deterministic, less flakiness I guess?