[OT] my experience with nullable types (C#)

Dukc ajieskola at gmail.com
Fri May 2 09:33:11 UTC 2025


On Wednesday, 30 April 2025 at 07:17:37 UTC, Kagamin wrote:
> Finally I had my chance to cope with nullable types in one of 
> our C# codebases, and the experience wasn't nice.

When I was coding In C sharp, I defined a generic class called 
`Ref` that I used when I wanted to pass structs by reference, and 
also as my nullable type. I didn't like the standard nullable 
type because I couldn't change my structs in place with it. 
Admittedly this was largely because I was stubborn and wanted to 
use structs as in D (meaning: when I didn't want polymorphism) 
instead of using classes for many of those things like C# 
designers probably intended.

Reading your experience I wonder if mine was actually the best 
way to go about the nullable type.


More information about the Digitalmars-d mailing list