Answer the question
In order to leave comments, you need to log in
How to organize the structure of the project file of your own program?
I have developed a program that generates binary type files for a specific purpose. Before generating a file, a lot of parameters are entered in the program. Entering these parameters every time anew is not advisable. In this connection, it became necessary to save the "project file". And it became interesting to me, what is the best way to store these parameters in a file, so that after them it would be easier and faster to read and process them?
For one reason or another, I repeatedly had to manually edit the "project files" of various programs, and the method of "storing" the parameters was completely different for everyone. For example, in some programs, the project file was binary (all parameters were marked in strict sequence and with specified field sizes), and in some the file was a set of lines (each line was a parameter that began with the name of the parameter surrounded by quotes and after which (separated by a dash or colon) followed by the value of this parameter).
So what should I be guided by when developing the structure and methodology for storing the "project file"?
Answer the question
In order to leave comments, you need to log in
Typical choices are
Name = Value for flat
Json data or xml for structured data
Perhaps the only criterion is whether this file will be read only by the program, or will people also read it? If only by the program - the binary is more convenient. I painted the structure, put it on the record - voila, sorted into the fields! But it will be quite difficult for a person to read it if people also read the file, it is better to spend money on a more or less full-fledged name=value type parser, if edited manually, it will be much easier.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question