Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

what file format(s) do you use for configuration files?

YAML.

  directoriesToBackup:
      /media/programming:
          exclude:
              - /media/programming/log_files
              - /media/programming/temp_files
      /media/documents:
          exclude:
              - /media/documents/archive


Wow! I've heard YAML mentioned before, but this is the first actual example I've seen.

I'm very embarrassed that this beautiful standard has been around for ~5 years without me noticing it.

/me goes off to read http://yaml.org/spec/1.2/


  /me goes off to read http://yaml.org/spec/1.2/
There's another problem. YAML is so simple, you don't need to read the damn manual for it. That example already taught you 80%. Ok, the easy 80%. But if you come from the Java (and XML) world, reading the manual is what you do just to get started.


Reading the manual once (at least the part with the examples) is indeed a good idea to get an overview of the possible constructs but once you have them down it quickly becomes a no-brainer. Under the hood YAML is surprisingly complex (can do full blown object serialization if you want to) but the everyday stuff is just perfect for typing it into an editor without thinking about it - and without matching up braces all the time like in JSON.




Consider applying for YC's Winter 2027 batch! Applications are open till November 2.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: