Software Engineer and full-time Rustacean. While Rust is my primary language, I am also fluent in Python and Typescript. I'm also currently making a game with Godot using C#.
I'm not sure I understand what you mean. YAML is not good as a serialization format. It is for configuration only. The comments are only for humans.
I do wish JSON allowed comments, however. This is the main reason why I prefer YAML over JSON for configuration files that are intended to be edited by humans.
Software Engineer and full-time Rustacean. While Rust is my primary language, I am also fluent in Python and Typescript. I'm also currently making a game with Godot using C#.
But for YAML, machines cannot preserve comments?
I'm not sure I understand what you mean. YAML is not good as a serialization format. It is for configuration only. The comments are only for humans.
I do wish JSON allowed comments, however. This is the main reason why I prefer YAML over JSON for configuration files that are intended to be edited by humans.
yaml.dump(yaml.load($string))
, and comments are lost.Ah ok. Yes I can see why this would be annoying.
I believe there are yaml parsers that do preserve comments but probably not for every language.