Talk:Null object: Difference between revisions

no edit summary
(Sounds good)
No edit summary
Line 10:
 
:I agree with Kevin, but I'm not sure how it should be reworded to make everyone happy without changing the examples. Any suggestions? --[[User:Mwn3d|Mwn3d]] 00:06, 6 August 2008 (UTC)
 
::I also agree. The problem with [[Ada]]'s null and [[C++]]'s 0/NULL is that neither is ''the'' object. They are values of a reference type. I cannot tell what was the intention of the task, thinkable interpretations:
::* An [ideal/imaginary/exceptional] object substitutable for anything. "Null object" sounds like an instance of the root type, the common ancestor of all types, provided that the language has such a type. In which sense it were "null"? That is unclear because even the root type usually has some methods (like sizeof, ==, etc). An object that '''has''' methods, which incidentally propagate exceptions when called, does not qualify as "null", does it? Otherwise, to have a "null object" would be enough to create a type with one method that always raise some exception.
::* Like above, but a value. null is such thing for reference types.
::* Unbound name. That could be a forward declaration, a deferred constant, external object (to be linked to) etc, which is left unbound until program crashes attempting to access the corresponding object (= a language design fault). Not very promising.
::* Anything else?
:: --[[User:Dmitry-kazakov|Dmitry-kazakov]] 08:05, 6 August 2008 (UTC)