null == "" is true?

Ola Fosheim Grøstad ola.fosheim.grostad at gmail.com
Tue Jul 19 16:24:58 UTC 2022


On Tuesday, 19 July 2022 at 15:30:30 UTC, Bienlein wrote:
> If the destination of a carrier was set to null, it implied 
> that the destination was currently undefined. Then the robot 
> brought the carrier to some rack where it was put aside for a 
> while till the planning system had created a new production 
> plan. The number of null pointer exceptions we had to fix 
> because auf this was countless. Never make null imply some 
> meaning ...

This is due to a lack of proper abstractions. Null always has a 
meaning, if it didn't, you would not need it. In this particular 
case you could have used a singleton instead.

In a relational database you can choose between having null or 
having a large number of tables. The latter performs poorly. I am 
not talking about how to implement null, I am talking about the 
concept of information being absent. If you have to represent 
that, you have a defacto "null", doesn't matter if it is a 
singleton or address zero or NaN or FFFE (for unicode).






More information about the Digitalmars-d-learn mailing list