DEV Community

Discussion on: Does yes and no have a "type name", like how true and false are called "boolean"?

Collapse
 
baenencalin profile image
Calin Baenen

For context, I'm using a language without nullable types, and I want a class that uses the values: "YES", "NO", "NEITHER".

Collapse
 
patricktingen profile image
Patrick Tingen

You might also need a value for "unknown", depending on your situation of course

Collapse
 
egilhuber profile image
erica (she/her)

What language?

Collapse
 
baenencalin profile image
Calin Baenen

GoLang

Collapse
 
baenencalin profile image
Calin Baenen

Also no, I'm not counting interface/pointer/etc... types as nullable.
Nil is not null, and I think that distinguishment needs to be made.