Templates: generic "return null;"

Dicebot public at dicebot.lv
Mon Feb 3 06:20:12 PST 2014


On Monday, 3 February 2014 at 14:10:35 UTC, bearophile wrote:
> Dicebot:
>
>> If you need cheap and simple way to figure out that attribute 
>> was missing, change API to return value by out parameter and 
>> turn normal return value into boolean success flag.
>
> It's probably better to start using Nullable.
>
> Bye,
> bearophile

Depends. If you control system as a whole, yes, it is better to 
build it on top of Nullable. If interfacing with external code is 
intended, it will just add more boilerplate.

Also I hate name "Nullable" and use it under name "Optional" :)


More information about the Digitalmars-d-learn mailing list