Live data from Hacker News

YAML: Probably not so great after all

arp242.net

301–310 of 457 posts

Re: YAML: Probably not so great after all

#301

I've used YAML as the format for a config file, and I certainly regret that choice. Trying to explain to someone that doesn't know YAML how to edit it without setting them up for failure is quite annoying. There are too many non-obvious ways to screw up, like forgetting the space after the colon or of course bad indentation.

Giving meaning to whitespace causes so many headaches and yet people still embrace Python, for some reason. I don’t understand it.

There are quite a few comments saying they don't like python even from 10+ year users.

Language becomes popular largely through library ecosystem and resources around it, not just how the language looks. I think Google embracing it had a good role in acquiring mind shares.

https://news.ycombinator.com/item?id=20672051

Re: YAML: Probably not so great after all

#302

So what's the HN consensus on the best format for config files? Is it TOML as the author seems to prefer at the end?

My vote is yes. Most configuration doesn’t need anything more sophisticated than key-value pairs, perhaps with namespaces. INI can manage that and TOML is basically a better-specified INI.

No reason to use INI over TOML. INI doesn't even have a standard specification.

Re: YAML: Probably not so great after all

#303
I have a completely unrelated question with the topic but derived from the font-face used in the article.

https://arp242.net/yaml-config.html#can-be-hard-to-edit-espe...

In the heading, how was sp ligatures in the `espcially` written, is there a name for this? How do you connect the beginning of a `s` to the beginning of a `p`?

Re: YAML: Probably not so great after all

#304

So what's the HN consensus on the best format for config files? Is it TOML as the author seems to prefer at the end?

I say just use JSON. Everyone knows it already and it's good enough. Use a parser in your app that allows comments and trailing commas like vscode does.

It's called JSON5. Don't bend JSON to confuse parsers.

https://json5.org/

Re: YAML: Probably not so great after all

#305
post #303

I have a completely unrelated question with the topic but derived from the font-face used in the article. https://arp242.net/yaml-config.html#can-be-hard-to-edit-espe... In the heading, how was sp ligatures in the `espcially` written, is there a name for this? How do you connect the beginning of a `s` to the beginning of a `p`?

These are discretionary ligatures [0].

They're turned on in html with the following two css lines (though on firefox, either one is enough to have them happen):

    font-variant-ligatures: common-ligatures discretionary-ligatures;
    font-feature-settings: 'liga' on, 'dlig' on;
[0]: https://www.fonts.com/content/learning/fontology/level-3/sig...

Re: YAML: Probably not so great after all

#306
S-expressions rule. I use them for configuration everywhere.

I wrote a lovely library for parsing them in Go (along with a full lisp interpreter if you like) https://github.com/glycerine/zygomys

Provides comments, multiline strings, and automatic translation into Go structs using reflection.

Re: YAML: Probably not so great after all

#307
post #303

I have a completely unrelated question with the topic but derived from the font-face used in the article. https://arp242.net/yaml-config.html#can-be-hard-to-edit-espe... In the heading, how was sp ligatures in the `espcially` written, is there a name for this? How do you connect the beginning of a `s` to the beginning of a `p`?

[deleted]

Re: YAML: Probably not so great after all

#309

Earlier quoted context omitted.

I say just use JSON. Everyone knows it already and it's good enough. Use a parser in your app that allows comments and trailing commas like vscode does.

JSON is for data. Not documents. Not config files. I don't agree with any "add this to JSON" comments. It's fine just as it is....for data.

Config files are data about program configuration. So “for data” and “not config files” don't go well together.

Re: YAML: Probably not so great after all

#310

I strongly recommend doing away with config files completely for sake of ease of use, maintainability and security. Instead just declare all config variables within code itself in a separate config class/module file, along with initialization to default values and provides dynamic getter/setter interface over a debug API (which can be enabled/disabled via a command line flag). If you want, you can also provide a frie…

I went from that to INI to TOML and back to that in 10 years.

It just makes things run smooth in TypeScript because all the members and types can be statically analyzed giving you errors, auto completion and ability to jump to the definition when config files cannot do that but probably not good for large projects with multiple languages.

For small projects I'm just taking the benefit over small concerns.

Post reply on HN