Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

2
  • This is similar to a Sentinal Value en.wikipedia.org/wiki/Sentinel_value It's a special value that signifies that your code should behave differently. I think the only requirement for using one is that it has the same type as an actual value, but it will not be realistically returned. So -1 could be a sentinal value for an algorithm that counts things but not for an algorithm that solves equations. Commented Mar 7, 2016 at 16:53
  • It's not really a sentinel value... Sentinel values have something to do with lists or sequences and work as a value that indicates the end of said list or sequence. Null Objects are specific objects that are designed to act as an object that has no specific behaviour. Commented Mar 7, 2016 at 18:34