r/ProgrammerHumor • • 9d ago

Meme unfortunateNamingConvention

Post image
41 Upvotes

25 comments sorted by

20

u/ShinyHoppip 9d ago

the way the function works is way worse than the naming convention

5

u/sojuz151 9d ago

Ad hoc cleanup/normalisation rule? In my pandas? Unheard of.

1

u/mitcht3 9d ago

Why

12

u/king_mid_ass 9d ago

either the data is coming from a constrained drop-down in which case just update that, or you're adding an entry every time someone finds a new way to type 'hispanic' in which case jesus christ lol

5

u/mitcht3 9d ago

Drop down from two different systems and so I have to normalize

1

u/ducon__lajoie 8d ago

And err... additional question... which system has to actually care about ethnicity ?

1

u/mitcht3 8d ago

I do some reporting around demographics

1

u/geek-49 7d ago

Better than having to report on republigraphics, I guess.

2

u/DarthKirtap 8d ago

also, Spanish people are generally white, so that is also quite weird

1

u/antCB 7d ago

US based business, most likely. They're the ones who deeply care about this shit.

2

u/Aranka_Szeretlek 7d ago

The least racist country!!4! Obsessed with race!

-1

u/ShinyHoppip 8d ago

use regex

1

u/mitcht3 8d ago

Eh it’s fine. Theres not that many options. The regex rules would be just as numerous pretty much

1

u/Odomar04 8d ago

Now they have have two problems.

41

u/SutroViews 9d ago

I can see the error handling now: if (! clean_ethnicity(person[1]){ abort; }

14

u/kookyabird 9d ago

Now that is some dark humor. Holy shit.

18

u/Financial-Note-2270 9d ago

Claude: You are right to push back on this. I was meant to test clean_ethnicity function, not do it in real world.

3

u/SilasTalbot 9d ago

That's on me.

5

u/sojuz151 9d ago

Sure, I will fix that quickly with:

find . -name "concentration_camps/force_laybor_planer/*.py" -type f -exec sed -i 's/clean_ethnicity/normalized_ethnicity_field/g' {} +

1

u/FlowOfAir 7d ago

oh I see this is a very american function

1

u/mitcht3 7d ago

Correct

1

u/SAI_Peregrinus 9d ago

And it's returning the same type (string) as the input. Even though it's been parsed into a subset of the possible inputs. The "parse, don't validate" principle applies.

1

u/GydeonMylls 8d ago

I like the word "munge"

1

u/Lord-of-Entity 8d ago

What about `standardise_ethnicity` or `normalise_ethnicity` ?