Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

null-less language

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?

Name: Anonymous 2013-10-14 15:48

default values for uninitialized variables make insidious bugs from typos

i think you are looking for option types though

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List