12

Just started a new job three weeks ago. I was doing pair programming with another developer that has been there two years; I was assigned an issue and wanted his opinion on it. He implemented a fix that involved multiple complex if statements.

He was surprised after I went ahead and showed him that the variable in question could be used (it was either 0, null, or > 0) like a boolean. I brought it down to 3 lines; a single if statement. Felt like a boss.

Comments
Add Comment