Shit programmers write
shitprogrammerswrite.com
Shit programmers write
1–10 of 82 posts
Re: Shit programmers write
#2Re: Shit programmers write
#3Re: Shit programmers write
#4Re: Shit programmers write
#5 return foo == null ? null : foo;Re: Shit programmers write
#6This feels horribly familiar. I'm not sure to recognize the specific language used, but there must be cases where one would like to target empty of filled with non processable characters strings only, and let null and falsy values pass through. This kind of use would typically need a line of comment, but hey...
Re: Shit programmers write
#7Love this one: return foo == null ? null : foo;
return foo == null ? true : false;Re: Shit programmers write
#8> if (Session["startDate"] + "" == "") This feels horribly familiar. I'm not sure to recognize the specific language used, but there must be cases where one would like to target empty of filled with non processable characters strings only, and let null and falsy values pass through. This kind of use would typically need a line of comment, but hey...
That if is equivalent to if (startDate + true)
EDIT: I was wrong. I haven't slept.
Re: Shit programmers write
#9Re: Shit programmers write
#10> if (Session["startDate"] + "" == "") This feels horribly familiar. I'm not sure to recognize the specific language used, but there must be cases where one would like to target empty of filled with non processable characters strings only, and let null and falsy values pass through. This kind of use would typically need a line of comment, but hey...
I'm guessing you don't realize that the plus operator has less precedence than the == operator. That if is equivalent to if (startDate + true) EDIT: I was wrong. I haven't slept.