Recommendations for creating custom file structures

I am currently very curious about how other programmers organize data into files. Can anyone recommend any good articles or books about best practices for creating file structures?

For example, if you created your own program for any purpose, you leave the saved data in plain text, serialize it, encode in xml and why do you do it?

Are there any secrets I missed?

+5
source share
7 answers

In general, go with the simplest thing that can work, at least in the beginning. Consider, for example, UNIX, where most configuration files are fields with spaces or fields separated by another character (for example, / etc / passwd, which uses the delimiters ":", since the GCOS field may contain spaces.)

If your data needs a much larger structure, ask yourself: "What tools can I use easily?" For example, Python and Ruby have JSON and YAML.

XML is mostly useful if you already have a lot of XML files, or you want to convert XML to a display form in a browser. Otherwise, it is usually very heavy (code size, complexity) for what you get from it.

+7
source

, , - ( , ).

. XML , , , .

, , :

  • () Matlab R
  • - ( , ). ( ?), , . .
  • XML - , ( XSD). XSLT (, , ).
+5

, -, , . , XML/JSON .., .

- Google (http://code.google.com/p/protobuf). , , . , TextFormat JSON. protobufs , . 2 , , .proto. . , , , , .

. Facebook Thrift, Apache.

+2

, , , , . , .

, , , .

, - , .

+1

+1 XML. , , . , . XSLT ( :)

+1

. :

  • ? ?
  • / ? ?
  • ? ?
  • , , ? ?

. ? ? ? ?

, , . (XML, CSV, YAML) . , .

+1

, XML

  • XML .
  • , XML
  • / , .
  • XSLT tranformer, , XML non XML
  • XML .
  • XML XSD , .
  • XML
  • , XML. Microsoft Office ..
  • XML -
  • XML -
0
source

All Articles