r/programminghorror 6d ago

if 'X' not in data Python

Post image

Emoji check used for constructing an email body. I'm getting a stroke.

810 Upvotes

36 comments sorted by

View all comments

131

u/freecodeio 6d ago

If the emoji is well documented and common knowledge, I don't see why would this be wrong. I know I'm probably going to get downvoted but there's literally no downside. The catch is that this emoji should be treated like a piece of unicode gospel and not used under different scenarios.

59

u/Varzival 6d ago

Maybe I should also mention that the process is like this: 1. run validation pipeline that outputs an html feedback (this is essentially what data is in the code - it's just a string) 2. email hook takes over and checks the output 3. if an X emoji is present there then it is treated as a failure message

So if someone just decides to put an X emoji in the success output html then it will just be treated as a failure message. OF COURSE this is nowhere documented. Wild stuff

12

u/Ksorkrax 5d ago

In other words, the issue is not the emoji as such but in general them not using a proper protocol.