1. Welcome to TechPowerUp Forums, Guest! Please check out our forum guidelines for info related to our community.

YAML sucks

Discussion in 'Programming & Webmastering' started by FordGT90Concept, Jan 1, 2013.

  1. FordGT90Concept

    FordGT90Concept "I go fast!1!11!1!"

    Joined:
    Oct 13, 2008
    Messages:
    12,971 (6.44/day)
    Thanks Received:
    3,084
    Location:
    IA, USA
    For those who haven't heard about it, here's the official site for it:
    http://www.yaml.org/

    Sure, it is a readable format but it is the worst format I've ever worked with in terms of coding for. I tried using other people's libraries (three of them I think) and was so confused, I trashed them. I tried coding my own, also resulted in confusion and trashing it. Finally, I decided the only way I can navigate the all important "spaces" (because they refuse to use tabs) was to use a tree so I could easily tell it to move between children and parents as it was parsing each line. That finally got the hierarchy mess sorted but then, to output the file back in YAML format, I had to write a wall of text because Trees aren't navigator friendly (have to open child after child after child and/or assign new objects to new objects to new objects). Not only that but in order to do the "name: value" at the end, I had to put in some shameful, unflexible wizardry to make it ignore outputting tabs (which breaks the format), not output colons, and ignore linebreaks. It's amazing it works at all.

    For the love of the computing gods, use XML, INI, or some other decent scripting format than YAML. They may not be as human ledgible as YAML but editors are relatively easy to make which end up being infinitely better than text editing a YAML anyway.

    JSON is better than YAML because it has brackets to tell when something starts and stops. YAML omits almost all of them.
    Crunching for Team TPU
  2. 3870x2

    3870x2

    Joined:
    Feb 26, 2008
    Messages:
    4,875 (2.17/day)
    Thanks Received:
    689
    Location:
    Joplin, Mo
    +1, same goes for HAML. They use white space for syntax, so editing is a SOB.
    FordGT90Concept says thanks.
  3. Aquinus

    Aquinus Resident Wat-man

    Joined:
    Jan 28, 2012
    Messages:
    5,560 (6.86/day)
    Thanks Received:
    1,752
    Location:
    Concord, NH
    I'll stick with JSON and XML, thank you. :)
    FordGT90Concept says thanks.
  4. FordGT90Concept

    FordGT90Concept "I go fast!1!11!1!"

    Joined:
    Oct 13, 2008
    Messages:
    12,971 (6.44/day)
    Thanks Received:
    3,084
    Location:
    IA, USA
    It's the format DynMap saves data in. I couldn't change it to something else and expect DynMap to still work. :(
    Crunching for Team TPU
  5. Jstn7477

    Jstn7477

    Joined:
    Aug 30, 2009
    Messages:
    3,720 (2.20/day)
    Thanks Received:
    1,434
    Location:
    Sarasota, Florida, USA
    Yeah, and basically every other Bukkit plugin out there including Bukkit itself uses it as well. :shadedshu
    FordGT90Concept says thanks.
    Crunching for Team TPU More than 25k PPD
  6. FordGT90Concept

    FordGT90Concept "I go fast!1!11!1!"

    Joined:
    Oct 13, 2008
    Messages:
    12,971 (6.44/day)
    Thanks Received:
    3,084
    Location:
    IA, USA
    Did not know that. Why would they use YAML when virtually no one manually edits them? They should use XML so it's easily program-read and those that do want to manually edit still can. We should petition Bukkit to change! :laugh:
    Crunching for Team TPU
  7. Jizzler

    Jizzler

    Joined:
    Aug 10, 2007
    Messages:
    3,268 (1.34/day)
    Thanks Received:
    597
    Location:
    Geneva, FL, USA
    Written back in 2009, so I guess this fad is still going.

    Haven't been exposed to it yet so I took a look at a YAML sample file just now...

    Barf.
    FordGT90Concept says thanks.
  8. newtekie1

    newtekie1 Semi-Retired Folder

    Joined:
    Nov 22, 2005
    Messages:
    19,484 (6.35/day)
    Thanks Received:
    5,725
    Yep, and most Minecraft Bukkit plug-ins use YAML for their config files. You have no idea how many times I've changed something in a plug-in restarted the server and had it not work. Then I have to go line by line in the config file to fine out where I went wrong. And it usually is something like I used a tab instead of spaces. Every time that happens I just want to scream.

    You should see the yml file for the server permissions...I'm glad I don't have to edit that manually.
    FordGT90Concept says thanks.
    25 Million points folded for TPU

Currently Active Users Viewing This Thread: 1 (0 members and 1 guest)

Share This Page