Giter VIP home page Giter VIP logo

Comments (7)

aaubry avatar aaubry commented on June 17, 2024 1

YAML has lost its way on human readability.

I don't think that this is the case, but if you believe that, it doesn't need to imply that we should "remove emphasis on human readability from documentation". A more constructive alternative is to identify places where YAML is deviating from this goal and find ways to steer it back towards it.

from www.yaml.org.

perlpunk avatar perlpunk commented on June 17, 2024

YAML has lost its way on human readability.

I find it very readable, and I am glad that many apps support YAML as a format.
Which format would you prefer for things like CircleCI, GitHub Workflows, Travis CI, Ansible etc.?

When a single space or leading 0 on a number can fundamentally change the outcome

  1. a space in the wrong place can also break a python script. That's the point of an indentation based language.
  2. a leading 0 on a number does not change the result in YAML 1.2.

from www.yaml.org.

jwschram avatar jwschram commented on June 17, 2024

I don't honestly expect my concern to be taken seriously but assuming you're responding in good faith I will engage.

The applications you mentioned are ones that benefit from an expressive data format which I admit YAML can be.

To the second point, python is a general purpose dynamic programming language and therefore an exacting syntax is expected.

Your second example is the exact reason my comment stands. The 1.2 spec allowing octals to be represented by 0o is a correction to the questionable decision of previously representing them with a leading 0, which is not in keeping with how humans read numbers. Secondly since YAML files aren't explicitly versioned you can't safely use a 0-leading number unless you can be sure it will be read by a 1.2 enabled parser.

This is just the tip of the iceberg for the other syntax features available in YAML, none of which are established human linguistic constructs.

So I say again, let's just lean into it and acknowledge YAML as a powerful and expressive format with a learning curve instead of pretending that it's somehow intuitive and trying to define it in opposition to JSON and XML, because at the moment YAML has more syntax and complexity than the two of them combined.

from www.yaml.org.

perlpunk avatar perlpunk commented on June 17, 2024

Secondly since YAML files aren't explicitly versioned you can't safely use a 0-leading number unless you can be sure it will be read by a 1.2 enabled parser.

YAML files can be versioned, and there are more and more processors developed that are capable of loading YAML 1.2.
Here is an example of the commandline tool for my YAML::PP processor:

% echo '%YAML 1.1
---
- 010
...
%YAML 1.2
---
- 010
' | yamlpp-load --yaml-version=1.2,1.1
$doc0 = [
          8
        ];
$doc1 = [
          10
        ];

A list of processors that support the YAML 1.2 Core schema and YAML 1.1 types like that so far:

YAML 1.2 was invented to improve such things, and the only problem is that there are many processors out there that don't support it yet.
So can we get at least the "leading zero" thing out of the discussion please? :)

I'm planning to add information like this to https://www.yaml.info/libraries/index.html, and we're hoping to get more developers on board to support 1.2.

from www.yaml.org.

perlpunk avatar perlpunk commented on June 17, 2024

none of which are established human linguistic constructs.

This is how a handwritten birthday party check list could look like:

Food:
- Onions
- Curly cale
- Paprika
- Tahini

Drinks:
- Juice
- Lemonade
- Water

That's perfectly valid YAML :)

from www.yaml.org.

jwschram avatar jwschram commented on June 17, 2024

@aaubry

I don't think that this is the case, but if you believe that, it doesn't need to imply that we should "remove emphasis on human readability from documentation". A more constructive alternative is to identify places where YAML is deviating from this goal and find ways to steer it back towards it.

Unfortunately that ship has sailed and increasing human readability while maintaining the current function set would require adding more syntax and complexity. Therefore I do not believe that your "constructive alternative" is really viable. That said, please consider, if YAML were not widely thought of as "being more human readable than JSON" would it cease to have value? Does JSON make a big deal about its human readability? Then it stands to reason that YAML can refer to human readability as a historical design goal, without losing anything.

I would also remind you that YAML redefined its own acronym! So this shouldn't be a big deal and we can stop trying to gaslight the world about human readability.

@perlpunk
Again, your YAML 1.2 example only works on a 1.2 parser, on a 1.0 or 1.1 parser it returns an unexpected result. It's not a saving grace, it's a condemnation.

Your checklist example is a purposefully basic one. I ask you, what are these syntax symbols?

--- >
--- |
&pat
*pat
?:

Do you think these are immediately obvious? If not that's a learning curve and cognitive load.

So in conclusion, YAML should just acknowledge that to become a flexible and powerful data format required making compromises to syntax readability that have already been done. It would simply be more honest to de-emphasize "human readability" as it doesn't change it's usefulness or adoption.

from www.yaml.org.

ingydotnet avatar ingydotnet commented on June 17, 2024

This repository is only regarding https://yaml.org content.
The spec is published from here but the sources are at https://github.com/yaml/yaml-spec

from www.yaml.org.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.