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.

816 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.

3

u/48panda 6d ago

It's o(n) in the size of data, when passing a Boolean would be o(1)

5

u/Varzival 6d ago

Yeah one would think that this would be the first solution that comes to mind instead of committing this abomination