jsonflutterdartyaml

Why Dart uses YAML as package manager?


I'm asking about the reason for using YAML for package managing pubspec.yaml in Dart, why did they choose YAML, not JSON? what is the unique thing in YAML that makes it a favourite for this purpose instead of another?


Solution

  • In my opinion:

    1. Readability

    YAML is much better... Like Python

    2. Commentary

    In JSON you can't give comments For flutter/Dart application maintenance, of course requires comments since the PUBSPEC file was created.

    3. Speed

    Indeed JSON files are smaller and faster, but for cross-platform developers, more emphasis on ease of reading and speed of production. Moreover, the development of mobile hardware is now very good.

    4. Complexity

    JSON structure is simpler, so it does not support complex configurations.


    But, YAML... be aware that "white space" (tabs v spaces) matters.