Name: Anonymous 2013-10-14 13:50
Assume an object oriented language where every object has a property "isDefault." In instances where an uninitialized variable is referenced or used, it simply returns an object with a default value (empty string, 0 for number types) where isDefault is true.
When coding, checks for null are no longer needed unless you specifically need to check for null, as comparisons won't cause null reference exceptions, and calling functions from objects will simply return that function's return value type's default value. So if "object" is undefined, "object.isSomething()" will return will return a boolean object with "isDefault" set to true.
What are the immediate problems with this idea, from a programming standpoint or language standpoint?
When coding, checks for null are no longer needed unless you specifically need to check for null, as comparisons won't cause null reference exceptions, and calling functions from objects will simply return that function's return value type's default value. So if "object" is undefined, "object.isSomething()" will return will return a boolean object with "isDefault" set to true.
What are the immediate problems with this idea, from a programming standpoint or language standpoint?