It would be nice to have default functionality common to binary/stringified NBT accessible with Nbt.[...], but the current NbtFormat/Nbt/StringifiedNbt naming doesn't work nicely with that.
Brief rationale:
Having Nbt.[...] for the API feels nicer from a naming perspective for basic un-configured serialization
This API could be added under the current (binary) Nbt class
but the companion object would implement NbtFormat, and it feels awkward/unexpected to be a different configuration type
This API could be added to the NbtFormat interface as a companion object
but it feels awkward/unexpected to have to write NbtFormat.encodeToNbtTag(serializer, value)
It feels better to me to have the Nbt class represent the general structure for the format, dealing with the in-memory representation and the NbtTag classes.
It would be an actual concrete & usable API, instead of just a parent interface for shared functionality.
Then, have more types of Nbt named according to what functionality they bring (BinaryNbt and StringifiedNbt).
This new naming means all general NBT API is named Nbt-, while binary/stringified API are BinaryNbt- and StringifiedNbt-, making the API easier to find through intellisense, and grouping code files more nicely when alphatized.
It would be nice to have default functionality common to binary/stringified NBT accessible with
Nbt.[...]
, but the currentNbtFormat
/Nbt
/StringifiedNbt
naming doesn't work nicely with that.Brief rationale:
Nbt.[...]
for the API feels nicer from a naming perspective for basic un-configured serializationNbt
classNbtFormat
, and it feels awkward/unexpected to be a different configuration typeNbtFormat
interface as a companion objectNbtFormat.encodeToNbtTag(serializer, value)
Nbt
class represent the general structure for the format, dealing with the in-memory representation and theNbtTag
classes.Nbt
named according to what functionality they bring (BinaryNbt
andStringifiedNbt
).Nbt-
, while binary/stringified API areBinaryNbt-
andStringifiedNbt-
, making the API easier to find through intellisense, and grouping code files more nicely when alphatized.