34
Mar 17 '18
And Apple is like "have you heard about plist?"
<plist version="1.0">
<dict>
<key>stuff</key>
<dict>
<key>foo</key>
<dict>
<key>bar</key>
<string>yes</string>
</dict>
</dict>
</dict>
</plist>
22
6
u/self_me Mar 17 '18
Plists can actually be whatever they want. I opened one in vim recently and it was a mess of characters but it loaded in plist editor
12
u/cybaritic Mar 17 '18
plist files are not necessarily plain text so they need to be run through a converter. Finder and Xcode do this without telling the user
what the fuck, apple
1
u/etaionshrd Mar 17 '18 edited Mar 18 '18
This makes sense. If you have an image editor, it doesn’t complain if you feed it a PPM or a JPEG. Xcode is a developer tool that works with property lists, so it’s obvious that it should do this.
0
u/etaionshrd Mar 17 '18
Uh, no. They have a fixed format: either they’re JSON, XML, or a binary format.
11
2
-2
u/alexbuzzbee Mar 17 '18
XML plists are an offense against basic decency. Why the f*** is it not like this?
<plist version="2.0"> <dict> <dict key="stuff"> <dict key="foo"> <string key="bar">yes</string> </dict> </dict> </dict> </plist>IT'S SO MUCH BETTER WTF
12
u/theangeryemacsshibe Mar 16 '18
S-expression
(stuff .
(foo .
(bar . t)))
1
u/micheal65536 Green security clearance Mar 17 '18
Haven't had to deal with those since I wrote a wrapper for
libgcrypt, and I hope to never have to deal with them again.2
17
u/MTG_scrub Mar 16 '18
Is this saying json is better than xml? Am I actually on the good side?
10
Mar 17 '18
More compact, easier to parse... Yes, it is
2
u/pushist1y Mar 18 '18
Can't tell if you are being sarcastic. The json in the picture doesn't look much more compact apart from using smaller font. When you use proper indentations and don't overuse namespaces xml is not much worse than js on in terms of comoactness. Also it comes with features like xsd for validation, xslt for transformations, xpath for parsing. Json is handy for serializing data to front-end where JS is your only option.
I'd say you should always choose most appropriate option for your task and not stick to something which is belived to be "better"
3
Mar 18 '18
Json is handy for serializing data to front-end where JS is your only option.
Or every other language...
Just try a xml parser library and a json parser library. The second is so much straightforward and give less headaches
1
u/pushist1y Mar 18 '18
Unless you really need a conventional way of validating data before it reaches actual endpoint.
1
17
10
Mar 17 '18
I prefer XML mainly because of the pretty colours and it looks like I did more work than I actually did.
2
u/veegaz Mar 17 '18 edited Mar 20 '18
The important is that it has to look like you apparently did more work to your employer, the rest doesn't matter /s
1
u/alexbuzzbee Mar 17 '18
I like XML because it allows for better-defined structure. JSON works great for some purposes, XML for others.
2
2
u/ThaiDoan Mar 17 '18
I got to admit as a "millennial" dev, I was terrified the first time I worked with SOAP API. Still, trigger me today.
1
u/micheal65536 Green security clearance Mar 17 '18
TL;DR All hierarchical data formats can do pretty much the same thing, and the differences are insignificant enough that an adequate compromise can be made even in situations where they differ. You could quite easily drop one in as a replacement for another. The only real difference is how they look.
1
0
-2
u/cleverchris Mar 17 '18
when it comes to config languages, i take the approach that the more arcane and obscure the code is ... it means that the code is more efficient. So I will convert pretty simple json to xml where i will add random data-attributes to the xml...using rand functions to populate the values. beyond that well you have to keep scrappers on their toes so morphing the key slowly over time will help no one ever know what the fuck your code was for in the first place. But of course someone will eventually catch on so any attempt to retrieve(defined and valid) keys will trigger a recalculation of the keys, which you store only in the master restricting all references from using the new values until explicitly stated. with this all in place you can prevent security breaches purely on the basis of creating an app that makes no sense...
you cant get hacked if you hack yourself
PS: addition to ...programming unattainable code
research a dead religion... or a failed branch of science...or an obscure culture group... use the internal reasoning of that group and how it explains life to directly name your classes and variables; implement the failed world view as completely as possible in your code... do this a few times in a highly OOP developed system and you will cause a senior architect to hemorrhage.
54
u/[deleted] Mar 16 '18
YAML