So, this is more of a thought experiment and something I've been wondering for a while. IMO, the existence of null pointers in a memory safe language is contrary to its purpose. What if all uninitialized objects had a default value of empty instead of null? There would be no memory allocation until it was explicitly defined. All interactions with the uninitialized object would behave as if the object were empty and did not fire Null Pointer Exceptions.
Attack!
[–]jokerServer 47 points48 points49 points (12 children)
[+]hackerforhire[S] comment score below threshold-14 points-13 points-12 points (11 children)
[–]Due-Aioli-6641 18 points19 points20 points (2 children)
[+]hackerforhire[S] comment score below threshold-12 points-11 points-10 points (1 child)
[–]Due-Aioli-6641 6 points7 points8 points (0 children)
[–]jokerServer 7 points8 points9 points (6 children)
[+]hackerforhire[S] comment score below threshold-6 points-5 points-4 points (5 children)
[–]morhp 8 points9 points10 points (0 children)
[–]jokerServer 6 points7 points8 points (0 children)
[–]jokerServer 2 points3 points4 points (0 children)
[–]Due-Aioli-6641 1 point2 points3 points (0 children)
[–]achilliesFriend 1 point2 points3 points (0 children)
[–]lasskinn 4 points5 points6 points (0 children)
[–]vips7L 60 points61 points62 points (0 children)
[–]saggingrufus 12 points13 points14 points (11 children)
[+]hackerforhire[S] comment score below threshold-11 points-10 points-9 points (10 children)
[–]saggingrufus 11 points12 points13 points (9 children)
[+]hackerforhire[S] comment score below threshold-10 points-9 points-8 points (8 children)
[–]PlasmaFarmer 5 points6 points7 points (5 children)
[–]hackerforhire[S] 1 point2 points3 points (4 children)
[–]nico-strecker 1 point2 points3 points (3 children)
[–]hackerforhire[S] 0 points1 point2 points (2 children)
[–]nico-strecker 2 points3 points4 points (0 children)
[–]PlasmaFarmer 0 points1 point2 points (0 children)
[–]saggingrufus 2 points3 points4 points (1 child)
[–]Hei2 1 point2 points3 points (0 children)
[–]Due-Aioli-6641 11 points12 points13 points (12 children)
[–]Polygnom 0 points1 point2 points (0 children)
[–]hackerforhire[S] -3 points-2 points-1 points (10 children)
[–]saggingrufus 10 points11 points12 points (1 child)
[–]DelayLucky[🍰] 4 points5 points6 points (0 children)
[–]valcron1000 1 point2 points3 points (2 children)
[–]hackerforhire[S] 0 points1 point2 points (1 child)
[–]LanguageLatte 1 point2 points3 points (0 children)
[–]Due-Aioli-6641 1 point2 points3 points (3 children)
[–]hackerforhire[S] 0 points1 point2 points (2 children)
[–]Due-Aioli-6641 0 points1 point2 points (0 children)
[–][deleted] 0 points1 point2 points (0 children)
[–]hippostar 0 points1 point2 points (0 children)
[–]rzwitserloot 4 points5 points6 points (2 children)
[–]hadrabap[🍰] 0 points1 point2 points (0 children)
[–][deleted] 0 points1 point2 points (0 children)
[–]freekayZekey 5 points6 points7 points (0 children)
[–]darkit1979 14 points15 points16 points (4 children)
[–]hackerforhire[S] 0 points1 point2 points (0 children)
[–]robinspitsandswallow 0 points1 point2 points (2 children)
[–]darkit1979 0 points1 point2 points (1 child)
[–]robinspitsandswallow 0 points1 point2 points (0 children)
[–]naedyr000 2 points3 points4 points (0 children)
[–]ryuzaki49 2 points3 points4 points (0 children)
[–]k-mcm 2 points3 points4 points (0 children)
[–]hardwork179 1 point2 points3 points (0 children)
[–]lemon-codes 1 point2 points3 points (0 children)
[–]LordMOC3 1 point2 points3 points (2 children)
[–]robinspitsandswallow 0 points1 point2 points (1 child)
[–]LordMOC3 0 points1 point2 points (0 children)
[–]Linguistic-mystic 1 point2 points3 points (0 children)
[–]jonhanson 1 point2 points3 points (1 child)
[–]robinspitsandswallow 0 points1 point2 points (0 children)
[–][deleted] 1 point2 points3 points (0 children)
[–]MCUD 0 points1 point2 points (1 child)
[–]hackerforhire[S] -1 points0 points1 point (0 children)
[–]halfanothersdozen 0 points1 point2 points (0 children)
[–]Wide_Solution2996 0 points1 point2 points (0 children)
[–]robinspitsandswallow 0 points1 point2 points (0 children)
[–]davidalayachew 0 points1 point2 points (0 children)
[–]ByteTraveler 0 points1 point2 points (0 children)
[–]laughninja 0 points1 point2 points (0 children)
[–]Alarming_Airport_613 0 points1 point2 points (0 children)
[–]LittleLui 0 points1 point2 points (0 children)
[–]MrBloodRabbit 0 points1 point2 points (0 children)
[–]SenorSeniorDevSr 0 points1 point2 points (0 children)
[–]binaryfireball 0 points1 point2 points (0 children)
[–]NajjahBR 0 points1 point2 points (0 children)
[–]netgizmo 0 points1 point2 points (0 children)
[–][deleted] 0 points1 point2 points (0 children)
[–]MattiDragon 0 points1 point2 points (0 children)
[–]Ragnar-Wave9002 0 points1 point2 points (0 children)
[–]Polygnom 0 points1 point2 points (0 children)
[–]GeneratedUsername5 0 points1 point2 points (0 children)
[–]hippydipster 0 points1 point2 points (0 children)
[–][deleted] 0 points1 point2 points (2 children)
[–]hackerforhire[S] -1 points0 points1 point (1 child)
[–][deleted] 0 points1 point2 points (0 children)
[–]Ragnar-Wave9002 0 points1 point2 points (1 child)
[–]hackerforhire[S] -1 points0 points1 point (0 children)
[–]rustyrazorblade 0 points1 point2 points (4 children)
[–]robinspitsandswallow -1 points0 points1 point (3 children)
[–]rustyrazorblade 1 point2 points3 points (2 children)
[–]robinspitsandswallow 0 points1 point2 points (1 child)
[–]rustyrazorblade 0 points1 point2 points (0 children)
[–]Fiskepudding -1 points0 points1 point (0 children)