TootSweet@lemmy.world to Programming@programming.devEnglish · 4 months agoThe Compiler Is Your Best Friend, Stop Lying to It - Daniel Beskin's Blogblog.daniel-beskin.comexternal-linkmessage-square15linkfedilinkarrow-up1125arrow-down12cross-posted to: hackernews@lemmy.bestiver.se
arrow-up1123arrow-down1external-linkThe Compiler Is Your Best Friend, Stop Lying to It - Daniel Beskin's Blogblog.daniel-beskin.comTootSweet@lemmy.world to Programming@programming.devEnglish · 4 months agomessage-square15linkfedilinkcross-posted to: hackernews@lemmy.bestiver.se
minus-squareexpr@programming.devlinkfedilinkarrow-up6arrow-down1·4 months agohttps://en.wikipedia.org/wiki/Algebraic_data_type Some reading material for you. Sum types allow for proper, compiler-enforced error handling and optionality rather than the unprincipled free for all that is exceptions and nullability. Tony Hoare, the person that originally introduced nulls to the programming world, is oft-quoted as calling nulls the “billion dollar mistake”. Here’s the talk: https://www.infoq.com/presentations/Null-References-The-Billion-Dollar-Mistake-Tony-Hoare/.
https://en.wikipedia.org/wiki/Algebraic_data_type
Some reading material for you. Sum types allow for proper, compiler-enforced error handling and optionality rather than the unprincipled free for all that is exceptions and nullability.
Tony Hoare, the person that originally introduced nulls to the programming world, is oft-quoted as calling nulls the “billion dollar mistake”. Here’s the talk: https://www.infoq.com/presentations/Null-References-The-Billion-Dollar-Mistake-Tony-Hoare/.