Yaml

Discussion in 'Bukkit Help' started by Fewmets, Jan 21, 2011.

Thread Status:
Not open for further replies.
  1. Offline

    Fewmets

    Why is it that all the newer plugins are using YAML formatting for their configs? Is it supposed to be faster? I haven't noticed any difference in performance on my server. The only difference I've seen is that it's more of a pain in the neck to read than the regular configs. Granted, I don't run a big server, but I still don't see how a config file can possibly create lag when it's only loaded and interpretted at startup, or a plugin reset...
     
  2. Offline

    Hidendra

    Could be because Bukkit uses YAML (for plugin.yml in plugins), so they figure they should as well.
     
  3. Offline

    Fewmets

    it just frustrates me because now I keep going to write my configs, and I wind up missing something, or putting something in wrong... it was so simple before... fill in the fields, and put commas between items...
     
  4. Offline

    Hidendra

    yeah, YAML does seem like it can be pretty confusing to people who haven't really seen it.

    For a simple config, yaml definitely shouldn't really be used (ie something=true).
    I guess it's nicer if the config would be more suited to XML (like the Permissions plugin)
     
  5. Offline

    Fewmets

    So, then, what IS the purpose of using YAML over a basic format? Is it a speed thing or what?
     
  6. Offline

    Hidendra

    Well, like you said config files can't really create lag (then again, I have seen plugins that read the config file everytime it does something, haha).

    I couldn't really find anything that says yaml is faster than everything else. It does have to parse it, so I imagine it can't be very much faster (if at all)

    The most I could find is using yaml instead of xml/json. I don't use yaml myself so I can't really say why people use it for their plugins. Perhaps it's easier to use, or just makes more sense to them.
     
  7. Offline

    Fewmets

    Yeah, i was thinking about the lack of much speed difference just after posting... hmm... Thanks for your help :)
     
  8. Offline

    croxis

    Yaml is a great connivance for programmers. I've only used it for python, but I assume that in Java it is the same way. It automatically converts everything into the right variable type or objects. It is also fantastic for serialization as well. It is also much, much better to work with than XML.
     
  9. Offline

    Shados

    Basically, if the plugin needs any sort of configuration more complex than simply setting 'something = some value', yaml provides a standardized format for doing so, and good existing code for reading and writing that format. Besides, if all of the plugin developers use yaml, then you only need learn it once :p.
     
  10. Offline

    Fewmets

    escept anything can be set in terms of something is something else... for christ sakes, yaml is the same thing, except it uses newline tables instead of csv's
     
  11. Offline

    Shados

    If you want to be pedantic, then yes, you can express anything in those terms. To more clearly explain what I said previously: If your configuration file needs to do anything more than just setting variables to simple scalar values, using YAML for its format is a good idea.

    YAML provides a standardized method for representing quite complex datatypes - arrays, hashes, sequences, any of them nested in any of them, as well as useful features like alias nodes and a whole bunch of other goodies. By using YAML, you get inbuilt support for all of this without having to write your own code to read and write it sanely, and you're using a known, well-defined, easy to learn format that has wide existing adoption.
     
    cholo71796 likes this.
  12. Offline

    Danxl5

    To add just a bit of a something to what Shados said,
    If you are having troubles with the spaces, try Notepad++ it can convert tabs to spaces to minimize on errors.

    I quite enjoy YAML. Make sure to read one or two tutorials, or even what is included in the config files, and it can be easy to pick up.
     
Thread Status:
Not open for further replies.

Share This Page