News for hackers. Stuff that matters.
Re:The Second Edition of “Refactoring” by myth_buster on Saturday December 01, 2018 @08:53PM (#18580286)
Re:The Second Edition of “Refactoring” by endgame on Sunday December 02, 2018 @01:01AM (#18581059)
Thinking more about this, null object are meant to be neutral with respect to some behaviour, but that behaviour isn't really specified alongside the object. It seems like it's a weaker reinvention of the idea of an "identity element" from e.g., the `Monoid` typeclass. I say "weaker" because `Monoid` specifies the neutral element (`mempty`) alongside the behaviour (`mappend`), whereas the null object pattern does not.