Skip to content

Configuration Format Comparison

Selina Lin edited this page Dec 13, 2021 · 2 revisions

To make codyze more user-friendly, we decided to add the option to specify configurations for codyze in a configuration file.
From the various formats that exist, we picked JSON, YAML and TOML to compare their features. These are currently some of the most popular formats and are supported in most of the popular programming languages.

JSON is the most widely used one of the three, so many users won't have to learn a new syntax. It is very expressive and can handle complex configurations.
However, it is rather difficult to read and edit in comparison to the others and doesn't allow comments which are quite important to have in a configuration file.

YAML has a very human-readable syntax, allows comments, and can also handle complexity very well. Typing is detected automatically per default which might be easier for users without a lot of programming experience.
Whitespace indentation is used to denote the structure which could be prone to syntax errors. This also does not scale well in files with a lot of nesting.

TOML is also very human-readable with a syntax similar to INI. Comments are allowed and the structure is denoted with [section names] so indentation is not significant.
The syntax is used to indicate the type, so quotation marks are required around strings, for example. It is the least expressive out of the three formats, but still sufficient for our purposes.

In the end, we chose YAML as the format for codyze. After writing a short configuration example in the three formats, Toml was the easiest to write and edit in our experience, YAML however has more support and libraries which was the deciding factor for our choice.

Clone this wiki locally