Why do we use YML?

Discussion in 'Plugin Development' started by bbq, Jul 1, 2012.

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

    bbq

    Why? The number one issue I have with writing plugins is the plugin.yml file. Compared to that the Java part is a piece of cake. It gets to the point where I have to configure plugins myself for server admins because the YML breaks randomly. It is just so stupidly strict.
    C++ and Java are good examples of non strict languages, they have a proper structure and thanks to that they don't have to be strict. YML on the other hand depends on spaces to try and understand what is happening. It just seems silly.
     
  2. we use YAML because its easy and powerefull what you can do whit it, it dont break random as you say, and it also need enters and spaces, not only spaces
     
  3. Offline

    Jacek

    It's good because there are very few control characters, so you don't have to worry about matching up brackets or anything like that. For a not-so-exprienced user it looks like a list, and lists are simple :)

    You don't have to use it in your plugin either, you could use any config file format you like.
     
  4. Offline

    gus

    along this vein, are there any good yml tutorials? i need a good package for editing yml and snakeyaml confuses the hell outta me. what do you guys use? should i just use snakeyaml?
     
  5. Offline

    Paul O'Reilly

  6. I had issues with yml too when I started plugin development, because of how I wanted it to be structured. Hence, I used JSON at that time (the gson parser is included in craftbukkit btw). JSON is working fine, might just not be as easy for the enduser as you'd think.
     
  7. Offline

    Sushi

    JSON and XML are both superior to YAML in my opinion, but YAML can be ridiculously easy to edit if you know how to do it without syntax errors. :p
     
  8. Offline

    Jacek

    Very true :D But for a non-technical user both of those look like crazy programming languages !
     
    codename_B likes this.
  9. Offline

    Cirno

    We use YAML because it can be read by the naked eye. Like what Jacek said, it would be like trying to understand another language (e.g Mandarin) without any prior knowledge. A more sophisticated example is would you rather talk to someone who spoke a different language then you, or talk to someone who speaks and understands the same language as you.
     
  10. Offline

    JOPHESTUS

    We use YML because EvilSeph said so!
     
    CarlosArias604 likes this.
  11. Offline

    bbq

    Hardly the open source spirit.

    I'm not saying it breaks randomly, rather that it is near impossible to see what you have done wrong at a glance as I can do with C++ for example. As someone who frequents the server admin forum at least half the errors I've seen are YAML related. I know a beginner server admin, and the first thing he said when I was explaining the difference between "strict" languages (C++, Java, etc) and "loose" languages (Python, LUA, etc) was how much he hated YML for not having some structure.
    Personally the output the online YAML parser gives is what I would like to use (maybe with out the ""). Many editors also fail when handling YAML, which is why I stick to Notepad++ (but remember many end users use other text editors, Apple's text edit for example seems to display HTML web pages, not the code when you load .html files- I hate to think what it would do with YAML).
     
  12. Offline

    nisovin

    You can't really compare YAML with C++ or Java. YAML is a markup language, not a programming language. And please, C++ and Java are both plenty strict, if you have a parenthesis or bracket out of place it won't work.

    If you want to do a comparison, compare YAML with JSON or XML. Those are valid comparisons. And both of those are just as strict. If you don't follow the rules exactly, they will break, just like YAML.
     
  13. Offline

    one4me

    Aside from the plugin.yml (which the end user should rarely mess with), you're not forced to use YAML while developing.

    And aside from commands, and permissions there isn't a whole lot to mess up in the plugin.yml
     
  14. Offline

    nisovin

    Also, what exactly do you mean by "strict" and "loose" languages? Didn't you say that C++ and Java aren't strict, but now you're saying they are? Also, YML does have structure, plenty of it. Isn't that what you were complaining about in the first place?
     
  15. Offline

    desht

    Leaving aside the fact that you did in fact say it breaks randomly, of course it's not impossible to see what you've done wrong. What you mean is that you don't understand YAML well enough to see. It just takes a little experience with YAML to get the hang of it - as languages go, it's really not that hard to pick up.

    Look, someone had to make a choice about what format configuration files would be, and they (the Bukkit team) chose YAML. Not XML, not JSON. So that's what we use. If you don't like it, feel free to contribute some code to Bukkit to read plugin.xml, plugin.json or whatever. And I'm sure a PR which added a JsonConfiguration or XmlConfiguration class (just extend FileConfiguration) would be well-received. Stop complaining, start coding :)
     
  16. Offline

    md_5

    All valid JSON is valid YAML, or maybe its the other way round?
     
Thread Status:
Not open for further replies.

Share This Page