Hacker News new | ask | show | jobs
by somehnreader 3384 days ago
Pardon my ignorance, but I don't even understand his point. I wouldn't even have bothered with a class at that level of abstraction.

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.