News for hackers. Stuff that matters.
Re:The Logical Disaster of Null by jcelerier on Thursday May 10, 2018 @04:00AM (#17037118)
That is only the case in reference-centric languages such as Java, C#, JS, etc. In value-based languages, "values" can't be null, while "references" can.

For instance a `std::string` or a `double` in C++ can never be null ; a pointer to either can be but that's far from idiomatic.

Re:The Logical Disaster of Null by lmm on Thursday May 10, 2018 @08:21AM (#17038177)
That approach doesn't really work, because C++ conflates where a value is stored with whether the value can semantically be null. Sometimes you want a nullable value that's on the stack. Sometimes you want a non-null value in the heap. Both these things are hard to do in C++.
Re:The Logical Disaster of Null by TheCoelacanth on Thursday May 10, 2018 @10:34AM (#17039166)
Neither of those is hard to do in C++. The first one is std::optional. The second one is a reference or a non-nullable smart pointer like https://github.com/dropbox/nn
Re:The Logical Disaster of Null by frabert on Friday May 11, 2018 @01:28AM (#17045148)
It's easy to do _since less than a year_
Re:The Logical Disaster of Null by jandrese on Friday May 11, 2018 @03:14PM (#17050067)
And probably not in your compiler yet. Or if it is, you'll blow up on thousands of other compilers when people try to build it themselves.
Re:The Logical Disaster of Null by jcelerier on Sunday May 13, 2018 @05:27AM (#17058070)
boost::optional has been available since 2003. There's no excuse.