by somehnreader · 9y ago · 0 comments
If I find repeating if statements throughout my code I put them in a method, end of story. Pseudopython:
def logging(logger, message):
if null == logger:
return
if null == message:
return
logger.write(message)
I don't understand why the author would even bother with more than this, given his example. Also note that I used two return (disguised goto's) as guard statements to check the conditions before I do anything.No comments yet.