Suspicions of nil
I'm feeling suspicious of nil.
What is nil?
In a recent newsletter I pondered true and false, and suggested that
thinking of them as normal, everyday objects could expand your ideas about
OOP. Today I'll continue with this theme by considering nil.
What is nil?
A straightforward, very concrete definition might be that it's an instance
of NilClass and a specialized kind of Ruby singleton that responds to 70+
public/protected methods.
Let's have a look...
评论
?
参与讨论