Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Property file dot separated key names

I just noticed that almost all the key values in property files are in dot separated names. eg -some.key=some value Does anyone know why? Just asked out of curiosity.

like image 933
Madz Avatar asked May 18 '12 10:05

Madz


2 Answers

It's basically a convention that makes it easier to see what properties are related.

For example:

person.title="Title" person.surname="Surname" job.description="Some description"

It's easy to see which properties are related and, using a smart editor, you can then chose to only see the properties for person. A few IDE's and editors can even use this to add code completion for you, as you know you want to work with person, but might not remember the exact property.

We sometimes underestimate the power of readability, yet a convention like this makes it easy for anyone to add, edit or maintain these properties. This becomes very important when working in teams or when on-boarding juniors.

like image 189
Ewald Avatar answered Oct 17 '22 09:10

Ewald


There is no any specific reason for that but it's just for better understanding of programmers nothing else. you can also directly write key=value without using any kind of "some" :-)

like image 43
Mayank Pandya Avatar answered Oct 17 '22 08:10

Mayank Pandya