Ranter
Join devRant
Do all the things like
++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatar
Sign Up
Pipeless API
From the creators of devRant, Pipeless lets you power real-time personalized recommendations and activity feeds using a simple API
Learn More
Comments
-
<?xml version="fuck yeah xml ftw" ?>
<because>
<reason>no other description-language <![CDATA[<escape/>]]>s more beautiful <![CDATA[^^]]>
</because> -
<j>
<u>
<s>
<t>
<b>
<e>
<a>
<u>
<t>
<i>
<f>
<u>
<l></l>
</u>
</f>
</i>
</t>
</u>
</a>
</e>
</b>
</t>
</s>
</u>
</j> -
There is a saying I usually say when I see bad things : "why do simple when you can overcomplicate ?"
-
Eariel19068yBecause the world existed before the 2000's and some stuff is not easy to refactor and rewrite?
-
monr0e12458yI just spent two days learning how to use json after never needing it before. I hate it already.
-
Grumpy28828y@monr0e JSON is described in its entirety in one single web page, and it's not a very long page: http://json.org/
JSON is very concise and to the point, without all the bloat of XML. If you need 2 days and not 2 hours to learn it, someone must have directed you to the wrong resources. -
As always, it should depend on your needs. Don't forget that XML also works with XSLT and XSD, which cannot be done with JSON. JSON is just JSON, nothing to enforce some required format/schema, etc.
-
@Grumpy I read about it a long time ago and completely forgot. So thank you very much for pointing that out to me! This time I should not forget ;)
-
klekih13268y@-FLX of course you can use other things to handle same requirements as xslt. Your taste, your freedom, your responsibility :)
-
DrEmann2538y@matanl give it a try and compare.
The extra semantics of (name, attributes, content) per tag vs. (attributes) make XML better for layout definition.
{
"kind": "p",
"class": "x",
"content": [
"hi",
{ "kind": "span", "content": "there"}
]
}
vs
<p class="x">
hi<span>there</span>
</p> -
matanl26448y@DrEmann might be, however closing tags are absolutely redundant and time consuming in my opinion. I thought of mapping each tag as an object but then the tags must be unique, so put them in an array, like that:
{
'html': [
{
'head': [
...
]
}, {
'body': [
...
]
}
]
}
Pretty confusing with all the tags. In my opinion building a tree should look like building a tree (i.e. a gui to generate html which saves time of writing start and end tags using keyboard shortcuts.)
Maybe we just came up with a startup idea :) -
JSON is the fucking best! But why the kitten I have to install an freaking API every Time?!
-
matanl26448y@brod you missed the flaw I noticed, in your method 2 consequent divs will override one another since keys are unique
-
@matanl @brod I was imagining something more like:
[
{
'class': ['dogs']
'content': [
'fluffy',
'pupper',
{ class: 'big', 'content': 'doggo' }
]
}
]
Everything by default is the equivalent of a div. When anything needs be different, it could be specified using 'type': 'textbox'.
All head stuff could be in the top somewhere. It could work -
@jerichoi224 I'm simple and readable. JSON doesn't have quite the history that XML has though
Related Rants
XML sucks. Why can't we just use JSON everywhere?
undefined
xml
json
ugh