5 ms·
While YAML has some warts, the "if" statement in there really cant be blamed on YAML as it does nothing but inserting a node in the object tree. You'd need some
by progre 6y ago
While YAML has some warts, the "if" statement in there really cant be blamed on YAML as it does nothing but inserting a node in the object tree. You'd need something else to act on that node. I get what the author is saying though, you should try to keep your config logic-free.
- PaulBGD_ 6y agoYeah, it seems the reason he mentions YAML specifically is because it has become highly used for these "build script"-like "config files".
- j16sdiz 6y ago/me looks at mongodb and groovy
- konjin 6y agoThat's like saying C doesn't have an if statement, you're just adding it to the AST, it's the CPU that does the actual jump not C. In short: a distinction without a difference.
- goto11 6y agoThe C language have an if-statement because it is part of the specification of the C language. YAML does not have an if anymore than JSON have an if because you can write {"if": "foo", "then": "bar"} and some processor can process this with if-semantics.