gvvaughan / lyaml

LibYAML binding for Lua.
gvvaughan.github.io/lyaml
Other
209 stars 34 forks source link

API: `encode/decode` vs `dump/load` #58

Open hinell opened 1 year ago

hinell commented 1 year ago

Hi.

I propose to stick to a more common names for encoding/decoding of API:

...
local        luatable = { ... }
local        lyaml.encode(luatable)
yamlString = lyaml.decode(...)

The naming is currently not obvious. Thanks!

alerque commented 1 year ago

The load() and dump() are pretty common names for this kind of actions, including in the Lua core (e.g. load) and in other YAML/JSON/other data format libraries. Of course there are counter examples even of other Lua YAML using encode()/decode() (especially ones that are bindings to other-language libraries. I'm just suggesting there isn't a clear cut normalized naming scheme to follow here.