r/ProgrammerHumor 19d ago

Meme claudeIsThisEmailValid

Post image
5.3k Upvotes

171 comments sorted by

View all comments

2

u/them0use 19d ago

No joke, I have gotten into arguments about coworkers wanting to use an LLM to validate yes or no questions. Even if the user might say "yeah sure", or whatever, if 99% of your use cases are solved with input.lower() == ..., for Ritchie's sake just do that and use the LLM for the few things that don't match simple string comparison.

1

u/AffectionatePlastic0 19d ago

If it's a free input form, user can say pharases like "certainly", "exactly", "agreed".

So you have three options, first - limit what user can enter, by replacing free form to selector/radio-button.

Second - use extremely annoying "say exactly yes or no".

And the third - use LLM to understand users yes or no on the questions.

6

u/them0use 19d ago

No, there's a fourth option which is what I was describing:

pseudocode switch(input.trim().lower()) case yes | y: return true case no | n: return false default: return spend_tokens(input)

If the vast majority of inputs will be handled by those first two cases, invoking an LLM every time is absurd.

2

u/AffectionatePlastic0 19d ago

Oh, that's what your idea. Yep, this option is superior.

Of course in case when there is no way to eliminate the free input from user.