3 ms·
An encoder is anything that serializes some data. Think `JSON.stringify()`.
by matt_kantor 7y ago
An encoder is anything that serializes some data. Think `JSON.stringify()`.
- sk5t 7y agoYMMV, I believe most folks would call that "serialization," reserving "encoding" for turning a notionally written-down-ish representation into bytes; e.g. string -> utf8 bytes, or float -> IEEE-754 bytes.
- regecks 7y agoRight, for some reason in Go (which Helm is written in), the standard library calls them encoders/decoders with marshal/unmarshal as the operations. Serialize is definitely the more common term generally.
- matt_kantor 7y agoI've seen it used even more generally for any `A -> B` (or `A -> Option<B>`) where B could be faithfully decoded back to A. In my head, serialization is a special case of encoding when B is some type of string. In this case it's YAML. I could probably have worded my previous comment more precisely.