Skip to content

Instantly share code, notes, and snippets.

// I'm designing something where there are multiple different objects that can hold
// exactly _one_ out of a couple of different other types, and I don't know what style I prefer.
//
// For example, an Input always has a name and it can hold a Symbol, a Target, or a Texture.
// It should always hold exactly one of them. In just the same way, a Symbol has a name and can
// hold different data of exactly exactly _one_ type of many.
//
// Which one of the following alternatives do you prefer?