If we put spring.datasource.url = url
it takes only one line.
However, If we put same thing in .yml
it takes 4 lines.
spring :
datasource:
url : url
Yet developers and frameworks(like Spring
) prefer .yml
over .properties
.
Why should we use .yml
over .properties
file?
Some Googling would have definitely helped you.
Ex : From http://javajee.com/a-quick-comparison-of-yaml-with-properties-file ,
YAML supports Maps, lists and scalar types. YAML is hierarchical and may use consistent spaces to denote hierarchy.
and,
Properties file is mainly used with Java, supports only String types and is non-hierarchical; we can have maps by denoting hierarchies as dots
Another long and descriptive guide is http://hsoienterprises.com/2014/03/10/property-list-vs-json-vs-yaml/ , which I'll leave for you to read.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With