Home > OS >  why dart uses yaml as package manager?
why dart uses yaml as package manager?

Time:09-27

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 favorite for this purpose instead of another?

CodePudding user response:

What is the difference between YAML and JSON?

Most importantly support for comments & Better readability

CodePudding user response:

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.

  • Related