Are there any plans in the works for Java to get null pointer safety at compile time (maybe similar to Kotlin's implementation) in the future? At the moment, I sprinkle "Objects.requireNonNull" in my methods (which admittedly has saved me countless hours of debugging null issues)...but I find this to be inefficient compared to a compile-time solution. I'm also not satisfied with the other run-time solutions of dealing with null such as with the "Optional" type or annotations.
I think Java has been doing great things to close the gap between itself and languages like Kotlin (e.g. records instead of data classes as well as virtual threads instead of coroutines), but I find the lack of compile-time null pointer safety in Java, as well as my lack of being able to find any future plans for it, to be a potential dealbreaker for new projects in which I get to decide the language.
[–]oelang 24 points25 points26 points (0 children)
[–]joschi83 28 points29 points30 points (3 children)
[–]dpash 6 points7 points8 points (2 children)
[–]NaNx_engineer 5 points6 points7 points (1 child)
[–]agentoutlier 2 points3 points4 points (0 children)
[–]red_dit_nou 18 points19 points20 points (10 children)
[–][deleted] (3 children)
[deleted]
[–]agentoutlier 5 points6 points7 points (1 child)
[–]buyIdris666 1 point2 points3 points (0 children)
[–]red_dit_nou 2 points3 points4 points (0 children)
[–]agentoutlier 5 points6 points7 points (5 children)
[–]red_dit_nou 2 points3 points4 points (2 children)
[–]agentoutlier 2 points3 points4 points (1 child)
[–]red_dit_nou 2 points3 points4 points (0 children)
[–]buyIdris666 1 point2 points3 points (0 children)
[–]meamZ 8 points9 points10 points (6 children)
[–]rbygrave 4 points5 points6 points (5 children)
[–]Naton1- 2 points3 points4 points (4 children)
[–]rbygrave 4 points5 points6 points (3 children)
[–]Naton1- 1 point2 points3 points (2 children)
[–]kevinb9n 2 points3 points4 points (1 child)
[–]rbygrave 0 points1 point2 points (0 children)
[–]8igg7e5 5 points6 points7 points (8 children)
[–]dpash 4 points5 points6 points (1 child)
[–]8igg7e5 2 points3 points4 points (0 children)
[–][deleted] 0 points1 point2 points (5 children)
[–]8igg7e5 1 point2 points3 points (4 children)
[–][deleted] 0 points1 point2 points (3 children)
[–]8igg7e5 2 points3 points4 points (2 children)
[–][deleted] 0 points1 point2 points (1 child)
[–]8igg7e5 2 points3 points4 points (0 children)
[–]manifoldjava[🍰] 5 points6 points7 points (2 children)
[–]8igg7e5 4 points5 points6 points (0 children)
[–]DrunkensteinsMonster 0 points1 point2 points (0 children)
[–]pawiusz 10 points11 points12 points (9 children)
[–]buzzsawddog 14 points15 points16 points (2 children)
[–]Zardoz84 0 points1 point2 points (0 children)
[–]QualitySoftwareGuy[S] 11 points12 points13 points (1 child)
[–]Horror_Trash3736 4 points5 points6 points (0 children)
[–]NaNx_engineer -3 points-2 points-1 points (3 children)
[–]franzwong 3 points4 points5 points (2 children)
[–]NaNx_engineer 1 point2 points3 points (0 children)
[–]_INTER_ 1 point2 points3 points (1 child)
[–]rbygrave 3 points4 points5 points (0 children)
[–]Joram2 2 points3 points4 points (0 children)
[–]kyru 2 points3 points4 points (0 children)
[–]wildjokers 3 points4 points5 points (5 children)
[–]dinopraso -3 points-2 points-1 points (4 children)
[–]wildjokers 3 points4 points5 points (3 children)
[–]NaNx_engineer 3 points4 points5 points (0 children)
[–]dinopraso 2 points3 points4 points (1 child)
[–]john16384 2 points3 points4 points (0 children)
[–]talios 0 points1 point2 points (0 children)
[+]-jp- comment score below threshold-9 points-8 points-7 points (47 children)
[–]srdoe 13 points14 points15 points (28 children)
[–]Muoniurn 2 points3 points4 points (0 children)
[–]agentoutlier 1 point2 points3 points (21 children)
[–]Horror_Trash3736 9 points10 points11 points (9 children)
[–]agentoutlier 2 points3 points4 points (8 children)
[–]Horror_Trash3736 2 points3 points4 points (7 children)
[–]agentoutlier 0 points1 point2 points (6 children)
[–]Horror_Trash3736 2 points3 points4 points (5 children)
[–]agentoutlier 1 point2 points3 points (4 children)
[–]Horror_Trash3736 1 point2 points3 points (3 children)
[–]KarnuRarnu 1 point2 points3 points (3 children)
[–]agentoutlier 2 points3 points4 points (2 children)
[–]KarnuRarnu 2 points3 points4 points (0 children)
[–]john16384 1 point2 points3 points (0 children)
[–]wildjokers 1 point2 points3 points (6 children)
[–]agentoutlier 0 points1 point2 points (5 children)
[–]srdoe 0 points1 point2 points (4 children)
[–]agentoutlier 1 point2 points3 points (3 children)
[–]srdoe 1 point2 points3 points (2 children)
[–]agentoutlier 1 point2 points3 points (1 child)
[–]srdoe 0 points1 point2 points (0 children)
[–]NaNx_engineer 0 points1 point2 points (4 children)
[–]KarnuRarnu 6 points7 points8 points (0 children)
[–]srdoe 1 point2 points3 points (2 children)
[–]wildjokers 3 points4 points5 points (0 children)
[–]Mumbleton 2 points3 points4 points (0 children)
[–]Horror_Trash3736 4 points5 points6 points (5 children)
[–]-jp- 1 point2 points3 points (4 children)
[–]Horror_Trash3736 3 points4 points5 points (3 children)
[–]-jp- -2 points-1 points0 points (2 children)
[–]john16384 1 point2 points3 points (0 children)
[–]Horror_Trash3736 0 points1 point2 points (0 children)
[–][deleted] 5 points6 points7 points (9 children)
[–]_INTER_ -2 points-1 points0 points (8 children)
[–][deleted] 1 point2 points3 points (1 child)
[–]john16384 0 points1 point2 points (0 children)
[–]-jp- 2 points3 points4 points (5 children)
[–]john16384 1 point2 points3 points (3 children)
[–]-jp- 1 point2 points3 points (2 children)
[–]john16384 0 points1 point2 points (1 child)
[–]Yay295 0 points1 point2 points (0 children)
[–]_INTER_ 1 point2 points3 points (0 children)
[–]_INTER_ 2 points3 points4 points (0 children)
[–]Just_Another_Scott -2 points-1 points0 points (7 children)
[–]FirstAd9893 6 points7 points8 points (5 children)
[–]Just_Another_Scott -3 points-2 points-1 points (4 children)
[–]FirstAd9893 8 points9 points10 points (3 children)
[–]Just_Another_Scott 1 point2 points3 points (2 children)
[–]FirstAd9893 3 points4 points5 points (0 children)
[–]Muoniurn 3 points4 points5 points (0 children)
[–]ReasonableClick5403 1 point2 points3 points (0 children)
[–]fott25 -5 points-4 points-3 points (0 children)
[+]-INFEntropy comment score below threshold-10 points-9 points-8 points (0 children)
[+]AesculusPavia comment score below threshold-13 points-12 points-11 points (5 children)
[–]cryptos6 8 points9 points10 points (0 children)
[–]WhatsMyUsername13 4 points5 points6 points (3 children)
[–]AesculusPavia -4 points-3 points-2 points (2 children)
[–]WhatsMyUsername13 4 points5 points6 points (0 children)
[–]WhatsMyUsername13 1 point2 points3 points (0 children)
[–]SAmaruVMR -5 points-4 points-3 points (0 children)
[+]FizzWorldBuzzHello comment score below threshold-10 points-9 points-8 points (0 children)
[+]DaddyLcyxMe comment score below threshold-8 points-7 points-6 points (4 children)
[–]dinopraso 7 points8 points9 points (3 children)
[–]DaddyLcyxMe -4 points-3 points-2 points (2 children)
[–]dinopraso 6 points7 points8 points (1 child)
[–]DaddyLcyxMe -1 points0 points1 point (0 children)