▶ No.912390>>912396 >>912556 >>923776
I would say it's far easier to parse than json.
▶ No.912394>>912447
Why did XML and JSON become popular instead of s-expressions, which is perfect for data formatting?
▶ No.912396>>912556
>>912390
it's easier to look at, not easier to parse. Look at all that text bloat.
▶ No.912397
>>912377 (OP)
That json whitespacing really triggers my jimmies
▶ No.912404>>912443
XML is a markup language.
JSON is a shit. But people love shit if it works and they don'y have to come up with something better.
▶ No.912443
>>912404
>JSON is a shit
You have to at least justify this annoying syntax with a reason
▶ No.912445
>>912377 (OP)
Because it's not as fucking hideous as the right.
▶ No.912447
>>912394
How would you unambiguously express a mapping data structure as a S-expression?
That is, if you encode and then decode a mapping data structure you always get a mapping data structure out, and if you encode and then decode a sequence you always get a sequence out.
A mapping data structure would be something like Python's dictionaries, and a sequence would be something like Python's lists.
▶ No.912463>>912524
>>912377 (OP)
Ironically android 'solved' xml by not putting content in the tags, rather the attributes of the tags define what actually is the content, the only time you would have content within tags is to use more tags.
▶ No.912464
>>912377 (OP)
>Why is the left still the format of choice?
XML has been dead for 15 years man
▶ No.912466>>912467
>>912377 (OP)
I prefer XML over JSON that hideous spacing makes me want to die.
▶ No.912467
>>912466
anon you can format xml exactly the same way. its a text format
▶ No.912468>>912475
json and xml suck ass. Edn is the best format i've seen
▶ No.912475>>912476
▶ No.912476
>>912475
>I love a format that is impossible to consistently parse
GJ mate
▶ No.912496>>912501 >>912507 >>912754
>>912377 (OP)
https://8ch.net/tech/0.json
Look at that complete puke. Now imagine how much easier it would be to read if it was xml
▶ No.912501
>>912496
Neither of them are intended to be human readable or editable, your argument is invalid.
▶ No.912507>>912532
>>912496
You know XML looks like dogshit too when you strip out all of the whitespace.
▶ No.912513>>912514 >>912519 >>912754 >>913153
>>912377 (OP)
Because the one on the right is Reddit spacing
▶ No.912514>>912557
>>912513
Its literally not tho
▶ No.912519>>912557 >>912565 >>912782 >>912938
>>912513
What people call "reddit-spacing" Is really just programmer-spacing. You can't use tabs to indent paragraphs (otherwise the comments are misaligned from the code), so you have to use a double-enter to denote them.
▶ No.912524
OP, XML is being used since the late 90's. There's way more content, tools and systems developed with it in mind.
If it was the other way around, probably XML wouldn't be largely adopted.
I just wish you never, EVER, have to deal with SOAP.
>>912463
I didn't know that. Here's one example I found after a quick search:
<!-- RelativeLayout in which we set green color for the background -->
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/greenColor"
tools:context=".MainActivity">
<TextView
android:id="@+id/firstTextView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:layout_margin="20dp"
android:padding="10dp"
android:text="First Text View"
android:textColor="@color/white"
android:textSize="20sp"
android:textStyle="bold" />
<!-- second TextView -->
<TextView
android:id="@+id/secondTextView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@+id/firstTextView"
android:layout_centerHorizontal="true"
android:layout_margin="20dp"
android:padding="10dp"
android:text="Second Text View"
android:textColor="@color/white"
android:textSize="20sp"
android:textStyle="bold" />
</RelativeLayout>
It doesn't look bad at all.
▶ No.912529
>>912377 (OP)
DTDs
< Yes, that's a pun where I'm calling you a retard and answering your question.
XML has a defined mechanism for metadata about itself.
▶ No.912532
>>912507
>VSCode
enjoy your telemetery, dumbass
▶ No.912551
>anything designed for javascript
▶ No.912556>>912615 >>912753
>>912390
>>912396
XML is easier to parse because everything is in descriptive tags
JSON is a mess to parse because everything is nested in brackets
▶ No.912557>>912570 >>912586 >>912896
>>912519
>>912514
reddit spacing you fucking niggers
▶ No.912561>>912571
>>912377 (OP)
Lol OP, come back when JSON has transformation capabilities as mature as XML, like xslt (pro tip you can't without named elements). Don't show me some edgy library or pseudo standard, because I know they are all shit.
After that, they might as well introduce namespacing support, it's there for a good reason in XML and that shitty JSON language just rapes you without it when you try to recognize by it's structure (pro tip you can't without a namespace).
JSON is a fucking joke, it should only be used for your soyboi projects and your's alone.
▶ No.912565>>913087 >>921955
>>912519
What people call "reddit spacing" is actually markdown.
▶ No.912571>>912813
>>912561
> Don't show me some edgy library or pseudo standard
Yeah unless its literally in the official JSON RFC its fake shit even if trivial solutions have been around for 10 years! You tell 'em!
▶ No.912586
>>912557
>formatting code is reddit spacing
this board gets worse and worse every day
▶ No.912615>>912753
>>912556
Do you even syntax analysis ?
▶ No.912743
>>912377 (OP)
A more important question: EBML vs. JSON?
▶ No.912753
>>912556
This.
>>912615
Write a fast json parser in c or c++ that shits out values, string or otherwise, with object,array,value as a header in single lines.
example:
["movies",378,"info","original_title"] "Flammen & Citronen"["movies",378,"info","actor_roles","Mads Mikkelsen"] "Citron"["movies",378,"info","actor_roles","Thure Lindhardt"] "Flame"
["movies",378,"info","titles",4] "Flame And Citron"
And most importantly, it has to work for non-standard implementations of JSON.
▶ No.912754
>>912496
><p class=\"body-line ltr \">Welcome to \/tech\/ -
It makes you puke because of the XML inside the JSON not because of the JSON itself.
>>912513
>reddit spacing
>zero empty lines
NO
▶ No.912755>>912756
Whenever I see XML, I smell Pajeet.
▶ No.912756>>912757
>>912755
Same here. It's degree of complexity is simply unnecessary in all situations.
▶ No.912757
>>912756
It's also heavily associated with SQL, Java, .NET, and "Enterprise" frameworks.
▶ No.912768
maybe they think they need the supports, sometimes its necessary
▶ No.912782
>>912519
>people
It's literally just one really dedicated aspie. That's the entire 'reddit spacing' "crowd"
▶ No.912813>>912871
>>912571
Name me the fucking standard for it then.
▶ No.912818
▶ No.912859
My eyes like reading JSON. My computer likes reading XML. JSON was made for my computer to read, not me. My computer is not me. JSON is not XML. Therefore:- my computer thinks JSON is shit.
▶ No.912862
they're both shit, and no, XML is not the format of choice in any "modern" web shit. only enterprise bros use it and even then not much anymore
▶ No.912871
>>912813
>If its not in the official JSON RFC it does not count
▶ No.912891
▶ No.912938>>912942 >>912947 >>921363
>>912519
Holy shit how can you be THIS stupid. Educate yourself.
▶ No.912942
>>912938
What if you just use org-mode a lot
▶ No.912947>>913108
>>912938
You still don't understand that people who program for a living have reasons to type that way.
▶ No.913087
>>912565
why are people posting markdown to a website that obviously doesn't have markdown support then
▶ No.913108>>913109
>>912947
>programming for a living
▶ No.913109
>>913108
>having a job
>not living with your mother
▶ No.913119
XML unironically looks better unless you're a symbols autist
▶ No.913151>>913285
xml is more powerful and therefore still needed. you nigger
▶ No.913153
▶ No.913285
>>913151
no, it isn't, but neither is JSON
▶ No.921332>>921334
>>912377 (OP)
both of them use too many special symbols that require pressing two keys to get the symbol
▶ No.921334>>921337
>>921332
Fuck off YAML shill. Go jerk off over the whitespace in your python scripts.
▶ No.921337
>>921334
>bootyblasted over the superior format having whitespaces
heh
▶ No.921363>>921780
>>912938
Reddit uses markdown. It's markdown spacing. Markdown
follows a long line of email formats. Many email clients don't
softwrap, so if you want paragraphs you need to hard wrap.
HTML ignores hardwrapping, because it has it's own
softwrapping, so when you translate markdown to HTML, it
deletes your hardwraps. Where else is softwrapping ugly as
fuck? Oh right, when youre programming.
▶ No.921369>>921895
Why not just use S-expressions and load that?
▶ No.921372>>921393 >>921986 >>922012
(empinfo
(employees
((name "James Kirk")
(age 40))
((name "Jean-Luc Picard")
(age 45))
((name "Wesley Crusher")
(age 27))))
Fixed.
▶ No.921393>>921792
>>921372
>adhoc unstandardized sexpers
durr
▶ No.921531
XML and JSON were both disasters, but fail at different things so are used by different groups.
▶ No.921780
>>921363
its not that hard to not press enter twice
▶ No.921792
>>921393
<data> ::= (empinfo <empinfo>)
<empinfo> ::= (employees <employee>*)
<employee> ::= ((name <string>) (age <number>))
wow that was hard.
▶ No.921895
▶ No.921955
>>912565
Markdown would be escaping linebreaks with \
▶ No.921986>>921987
>>921372
Looks like unreadable shit. You can tell where the words are, but if you fucked up the parentheses (for example remove one of the last 4) there's no way you would know at glance.
▶ No.921987>>921989
>>921986
>there's no way you would know at glance.
That's what computers are for.
▶ No.921989>>921992
>>921987
Computers are for binary data, not your gay expressions.
▶ No.921992>>921993 >>921998 >>923774
>>921989
Hello? These are formats for exchanging data between computers. Yes, we like if they are human readable, but of course the hierarchy will be ruined if you delete a character. You could make the same argument about json. You could make deleting a '/' from a closing tag in XML fucks it up too.
▶ No.921993
>>921992
*make a mistake... which fucks it up...
▶ No.921994
▶ No.921998>>922005
>>921992
>computers can't understand file formats unless they're in some markup text language
Do you even computer?
>You could make the same argument about json
No you can't, the difference is that XML and JSON are much more human readable. If it's missing something then you can see it easily.
▶ No.922005>>922012
>>921998
Wrong. JSON also suffers from bracket hell at the end of complicated structures ]}]]]}. I cannot help you understand the first part, just count it as yet another thing you failed to understand.
▶ No.922012
>>922005
JSON isn't read by humans in a form with compressed brackets like LISPfags like doing with their shit. See >>921372 . No one would ever do that kind of madness with C.
▶ No.922135
Much much easier to parse XML than JSON I guess? Not that you'd know, as you've never programmed even a reverse polish calculator parser.
▶ No.922138>>923780
XML is much more powerful
▶ No.923369
>>912377 (OP)
Name spaces. Metadata. Validators.
>but who ever uses those?
Apparently enough.
▶ No.923744
XML is easier to read, but JSON has semantics built-in which make object composition more straightforward. You have lists, maps, and singe-values. When I need to serialize data in a program I'm writing, it's conceptually clear how the objects or data will be mapped into a JSON object. With XML, you have only two types to work with: tree and single-values. There is a wider conceptual gap between the data being serialized and the format itself.
▶ No.923751>>923790
JSON has no types and adding types makes it look like shit. It has no comments and adding comments makes it look like shit. It can't handle binary data at all. Almost no JSON parser actually parses JSON correctly. Don't believe me? Try adding a large floating point number and then parse it and re-serialize it with your library of choice. You'll get data loss with almost all of them. It's webdev-tier garbage.
▶ No.923752
JSON is a true choice for White People, you are literally using a nigger to do the job for you.
▶ No.923774
>>921992
Hey javanigger, if you want to transfer data between computers efficiently, you compress it into a raw datastream. XML is best used for configuration data that needs to be both human-readable and easy to parse for computers (and in many cases, also easy for humans to edit in a text editor).
▶ No.923776>>923778
>>912377 (OP)
They're both unreadable but at least you can have an IDE that will highlight what's XML and what is not, and like anon said >>912390 XML is easier to parse. So that makes XML better.
And if you use JSON you're getting into the java ecosystem which anyone who values their time, money and sanity wants to avoid like the plague.
▶ No.923778
>>923776
>IDE that will highlight what's XML and what is not
meant
>IDE that will highlight what's XML/JSON and what is not
▶ No.923780
>>922138
Oh yeah, I feel really powerful when I parse an XML document and my computer needs to connect to some remote server to finish parshing it.
XML is powerful in the same way Javascript is.
▶ No.923787
>>912377 (OP)
Crucial:
Schemas
Namespaces
Convenience:
Comments
Cleaner diffs (that fucking comma at list/object end)
Minor:
Can be used for markup (quite niche)
Tool & library support that comes with being standard for decades. XPath, XSLT, etc (JSON is catching up)
Controversial:
Attributes (cancerous & misused in 95% cases, but perfect fit for 5%)
Only problem with XML is that is was used for simple cases, where it's functionality was overkill.
>>912454
>keys without quoting
>let's double syntax complexity for minor convenience
Into the trash it goes. There is a reason why JSON syntax is one page and YAML is a fucking book
▶ No.923790>>923863
>>923751
>Try adding a large floating point number and then parse it and re-serialize it with your library of choice.
>json.loads('1.1', parse_float=decimal.Decimal)
>{0, 1123, -9} = jsonx:decode(<<"1.123e-6">>, [{number_format, decimal}]).
And?
▶ No.923863
>>923790
>json.loads('1.1', parse_float=decimal.Decimal)
Now try re-serializing it with dumps. While it can be done, it's ugly.
>{0, 1123, -9} = jsonx:decode(<<"1.123e-6">>, [{number_format, decimal}]).
Erlang is a meme. Try parsing a string with \ud83d in it.
And then try sending long floats to a browser and see what happens.