Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

  def mom(believe_hallmark = False, mom_exists = False, mom_cares = False):
    if (believe_hallmark == True and mom_exists == True and mom_cares == True):
        print('Call Mom')
    else:
        print('Nah')

  mom(False, True, False)
License: This code is open source.

[EDIT] I'd forgotten how poorly humor fares on HN.



`== True` is triggering


I have mixed feelings. I prefer “if (condition)”, but I dislike “if (!cond)”, since the exclamation looks sneaky, especially when the condition is a method call or a long variable. But I dislike the dis-symmetry of using != but not == . Programming syntax taste is hard!!


But it's clearly Python, so it would be the very not-sneaky “not” instead of “!”.


For many environments, better performance can be found by swapping the "and" conditions with "or" conditions.


I suspect the highest mom-wisdom is knowing that Hallmark is full of crap.

Ergo mom(False, True, True)


I mostly downvoted for the uneven indenting TBH




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: