News for hackers. Stuff that matters.
Re:YAML: Probably not so great after all by regecks on Sunday August 18, 2019 @06:51PM (#20733452)
Why would they have chosen to use template/text to generate YAML? That seems insane.

Surely using an encoder on an object/structure hierarchy (like people do with encoding/json) is the way to go?

On the other hand, the quality of the yaml libraries in Go wasn't great, last time I had to choose a configuration file format.

Re:YAML: Probably not so great after all by dharmab on Sunday August 18, 2019 @06:52PM (#20733460)
A lot of people working with YAML have an ops background and aren't familiar with basic data structures.
Re:YAML: Probably not so great after all by kevml on Sunday August 18, 2019 @07:46PM (#20733692)
That’s disingenuous. Most “ops” folks I work with despise templating files but it’s the easiest way to parameterize things, especially when providing ways for “devs” to do “ops”.

Yes, we may not have a cleaner way of deploying k8s Deployment configs to different clusters but the desire to templatize YAML is easy for everyone to understand. The decision to abstract or templatize is one rooted in time and cost, not ability to understand data structures.

Re:YAML: Probably not so great after all by dev_dull on Sunday August 18, 2019 @07:39PM (#20733660)
personally I’d prefer a templatized yaml file over an over-engineered, snowflake DSL created by a “real programmer” and not an ops person.
Re:YAML: Probably not so great after all by celim307 on Sunday August 18, 2019 @07:43PM (#20733679)
Ok, those aren't the only two choices though.
Re:YAML: Probably not so great after all by wmil on Monday August 19, 2019 @04:34AM (#20735963)
It probably starts with an existing YAML config file that you only need to pass one or two variables to. Then things get out of hand.
Re:YAML: Probably not so great after all by Noumenon72 on Sunday August 18, 2019 @09:19PM (#20734147)
What is "an encoder"? Like a function that takes the same variables as the template would but does some work itself generating things?
Re:YAML: Probably not so great after all by matt_kantor on Sunday August 18, 2019 @10:42PM (#20734481)
An encoder is anything that serializes some data. Think `JSON.stringify()`.
Re:YAML: Probably not so great after all by sk5t on Sunday August 18, 2019 @11:45PM (#20734722)
YMMV, 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.
Re:YAML: Probably not so great after all by regecks on Monday August 19, 2019 @02:45AM (#20735457)
Right, 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.
Re:YAML: Probably not so great after all by matt_kantor on Monday August 19, 2019 @10:20AM (#20737954)
I'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.