News for hackers. Stuff that matters.
Re:If statements considered harmful by somehnreader on Tuesday March 14, 2017 @06:15AM (#13866309)
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.

There are no comments on this comment yet.