techPowerUp! Forums

techPowerUp! Forums (http://www.techpowerup.com/forums/index.php)
-   Programming & Webmastering (http://www.techpowerup.com/forums/forumdisplay.php?f=52)
-   -   YAML sucks (http://www.techpowerup.com/forums/showthread.php?t=178071)

FordGT90Concept Jan 1, 2013 01:39 PM

YAML sucks
 
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.

3870x2 Jan 1, 2013 01:52 PM

+1, same goes for HAML. They use white space for syntax, so editing is a SOB.

Aquinus Jan 1, 2013 02:21 PM

I'll stick with JSON and XML, thank you. :)

FordGT90Concept Jan 2, 2013 04:08 AM

It's the format DynMap saves data in. I couldn't change it to something else and expect DynMap to still work. :(

Jstn7477 Jan 2, 2013 04:13 AM

Quote:

Originally Posted by FordGT90Concept (Post 2813558)
It's the format DynMap saves data in. I couldn't change it to something else and expect DynMap to still work. :(

Yeah, and basically every other Bukkit plugin out there including Bukkit itself uses it as well. :shadedshu

FordGT90Concept Jan 2, 2013 04:30 AM

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:

Jizzler Jan 2, 2013 05:34 PM

Quote:

Originally Posted by Ciaran McCreesh (blogger)
YAML, like XML (but don’t say that around YAML fans, because they will insist that YAML is nothing like XML), is a faddish structured text format that, by virtue of its generality and abstractness, ends up being harder to work with even with a parser already written than an appropriately designed one-off flat text format.

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.

newtekie1 Jan 2, 2013 06:29 PM

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.


All times are GMT. The time now is 08:25 AM.

Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.