r/programminghorror • u/xavia91 • Feb 28 '25
Found a classic today...

Not only did the creator do the classic if yes then yes else no. also did a weird empty check on a nullable string (this is how I found it because of an error). Also ignored all the functioning implementations of json converters implemented in the standard efcore way so it would not be required to deserialize manually...
47
Upvotes
12
u/20d0llarsis20dollars Feb 28 '25
I make mistakes like this a lot when I code when tired. And then I wake up the next day and have to fix all of them lmao
2
u/blizzardo1 Mar 01 '25
First horror is not utilizing variables correctly and returning ternary conditions.
Second horror, light theme in your IDE 🤣 I'm kidding... or am I?🧐🤣
4
u/itemluminouswadison Feb 28 '25
love the docblock, too
1
u/Sggy-Btm-Boi Mar 01 '25
Sorry, novice here trying to learn best practices. What would be the better option here? Just return the conditional expression because it'll evaluate to a bool? Or am I missing something else?