Why does nobody seem to think that `null` is a serious problem in D?

Dukc ajieskola at gmail.com
Sat Dec 1 11:16:49 UTC 2018


On Saturday, 1 December 2018 at 00:32:35 UTC, Tony wrote:
> isocpp.org just had a link to a blog post where someone makes a 
> case for uninitialized variables in C++ being an advantage in 
> that you can potentially get a warning regarding use of an 
> uninitialized variable that points out an error in your code.
>
> https://akrzemi1.wordpress.com/2018/11/22/treating-symptoms-instead-of-the-cause/

This is grat when it works, but the problem is that it would be 
gargantuan effort -and compile time sink- to make it work 
perfectly. When it's just about if-else if chains, switches or 
boolean logic as in the example, the analysis won't be too 
complicated. But swap those booleans out for a string, and make 
the conditions to test whether it's a phone number, and whether 
it satisfies some predicate implemented in a foreign langauge, 
and you'll see where the problem is.


More information about the Digitalmars-d-learn mailing list