Register a SA Forums Account here!
JOINING THE SA FORUMS WILL REMOVE THIS BIG AD, THE ANNOYING UNDERLINED ADS, AND STUPID INTERSTITIAL ADS!!!

You can: log in, read the tech support FAQ, or request your lost password. This dumb message (and those ads) will appear on every screen until you register! Get rid of this crap by registering your own SA Forums Account and joining roughly 150,000 Goons, for the one-time price of $9.95! We charge money because it costs us money per month for bills, and since we don't believe in showing ads to our users, we try to make the money back through forum registrations.
 
  • Post
  • Reply
X-BUM-RAIDER-X
May 7, 2008
tiny bug childe have you rid yourself of tbi yet?

Adbot
ADBOT LOVES YOU

Workaday Wizard
Oct 23, 2009

by Pragmatica
why do plangers think xml is bad??

whenever i needed to store config or whatev i just use xml and tinyxml/etc.. and BAM!! it's done


can someone xplain to me why ppl think xml is bad
thank you and dog bless

Bloody
Mar 3, 2013

Shinku ABOOKEN posted:

why do plangers think xml is bad??

whenever i needed to store config or whatev i just use xml and tinyxml/etc.. and BAM!! it's done


can someone xplain to me why ppl think xml is bad
thank you and dog bless

it takes up so much space

coffeetable
Feb 5, 2006

TELL ME AGAIN HOW GREAT BRITAIN WOULD BE IF IT WAS RULED BY THE MERCILESS JACKBOOT OF PRINCE CHARLES

YES I DO TALK TO PLANTS ACTUALLY

Bloody posted:

it takes up so much space

does your editor not support collapsing regions + auto tag insertion

X-BUM-RAIDER-X
May 7, 2008
xml is good if you don't plan on reading or editing it yourself

it's bad if you do

if you ever find yourself actually doing the latter tho then you're probably a lovely programmer for not ensuring that you do not have to do it

Bloody
Mar 3, 2013

coffeetable posted:

does your editor not support collapsing regions + auto tag insertion

oh no it does this is just what idiot plangers complain about

coffeetable
Feb 5, 2006

TELL ME AGAIN HOW GREAT BRITAIN WOULD BE IF IT WAS RULED BY THE MERCILESS JACKBOOT OF PRINCE CHARLES

YES I DO TALK TO PLANTS ACTUALLY
whoops sry

uG
Apr 23, 2003

by Ralp

OBAMA BIN LinkedIn posted:

xml is good if you don't plan on reading or editing it yourself

it's bad if you do

if you ever find yourself actually doing the latter tho then you're probably a lovely programmer for not ensuring that you do not have to do it

HORATIO HORNBLOWER
Sep 21, 2002

no ambition,
no talent,
no chance
xml rules

tef
May 30, 2004

-> some l-system crap ->

OBAMA BIN LinkedIn posted:

xml is good if you don't plan on reading or editing it yourself

it's bad if you do

yep, xml is a sorta ok serialization format for computers to read and write and occasionally for humans to inspect, and rarely for humans to edit or write. (i.e there is a reason xslt isn't that popular)

the well formed part makes it awkward for humans to write well, including recalling escape characters and different escaping rules depending on context.

the schemas are ok, but many of the tools that claim to support them have weird limitations, so it sorts ended up being abandoned or not so useful to be worth the effort. (hi mssql!)

on the plus side it actually supports utf-8, and xpath is a wonderful, wonderful thing.

on the massive, parsing xml is chunky, complex and hard, so hard in fact there are a plethora of security issues, like denial of service attacks.

tef
May 30, 2004

-> some l-system crap ->
tl;dr xml is ok for trusted interchange and more platform neutral formats, xpath owns, but security and editing are way harder

X-BUM-RAIDER-X
May 7, 2008
this tbc tef shaggar av exchange is getting way out of hand

Notorious b.s.d.
Jan 25, 2003

by Reene

OBAMA BIN LinkedIn posted:

this tbc tef shaggar av exchange is getting way out of hand

yeah i thought i was about to agree with tbc and i felt fear

double sulk
Jul 2, 2010

Notorious b.s.d. posted:

yeah i thought i was about to agree with tbc and i felt fear

      
      Avoid Symmetry, Allow
        Complexity, Introduce
               Terror









                               w
                               o
                               w



      s o  s a t a n



         l f e s r u o y  e z i n a m u h e d












         u s e  p h p

   i
   n
   s
   t
   a
   l
   l

   g
   e
   n
   t
   o
   o






h a i l   s a t a n

Jonny 290
May 5, 2005



[ASK] me about OS/2 Warp
We needed something to build wireless configs out of and I built a pretty sweet structure that played nicely with perl's XML implementation as that's all we would be using, and it works flawlessly and ive gotten kudos for it from both technical and financial stakeholders soooo works4me

Suspicious Dish
Sep 24, 2011

2020 is the year of linux on the desktop, bro
Fun Shoe

tef posted:

on the massive, parsing xml is chunky, complex and hard, so hard in fact there are a plethora of security issues, like denial of service attacks.

the best part is there's a bunch of obscure xml features which the standard testcase requires you to support but nobody ever uses and have security issues

http://en.wikipedia.org/wiki/Billion_laughs

Nomnom Cookie
Aug 30, 2009



Never use an unknown dtd

Shaggar
Apr 26, 2006

tef posted:

yep, xml is a sorta ok serialization format for computers to read and write and occasionally for humans to inspect, and rarely for humans to edit or write. (i.e there is a reason xslt isn't that popular)

the well formed part makes it awkward for humans to write well, including recalling escape characters and different escaping rules depending on context.

the schemas are ok, but many of the tools that claim to support them have weird limitations, so it sorts ended up being abandoned or not so useful to be worth the effort. (hi mssql!)

on the plus side it actually supports utf-8, and xpath is a wonderful, wonderful thing.

on the massive, parsing xml is chunky, complex and hard, so hard in fact there are a plethora of security issues, like denial of service attacks.

luckily, every language worth using has an xml parser already so you don't have to worry about it. plus many now disable features that aren't gonna be used by default to help limit exposure to dos attacks. and if you're using soap and wcf/cxf they handle all the parser configs as well so you don't need to worry about anything. its only when you start trying to re-solve those problems that you need to worry about all the edge cases. just let the people who already did it handle it for you.

also xml with schema is very easy to write cause editors will auto complete and validate everything for you while you type.

the xml datatype in mssql is kind of a hack tho. people kept storing their xml in blob/text/varchar or w/e and then wrote their own udfs to parse it so Microsoft gave them a datatype + tools to prevent the security and performance problems you get from bespoke implementations. using it to store xml that you may want to be able to poke at w/ sql for an export or maybe some custom reporting is ok, but using it as sort of a dynamic column store should be a hanging offense.

for the few downsides it has and the lack of any real competitor, xml is still the best for the majority of serialization needs.

Notorious b.s.d.
Jan 25, 2003

by Reene

Shaggar posted:

for the few downsides it has and the lack of any real competitor, xml is still the best for the majority of serialization needs.

this

nobody really loves xml in its current form but there is no viable alternative. people who pitch json or yaml as alternatives to xml have failed to understand what xml does

Socracheese
Oct 20, 2008

please inform my scrub brains, i have only used xml in situations where json would have also worked, wat can it do that json cannot

Nomnom Cookie
Aug 30, 2009



Tag names

Notorious b.s.d.
Jan 25, 2003

by Reene

Socracheese posted:

please inform my scrub brains, i have only used xml in situations where json would have also worked, wat can it do that json cannot

schemas, validation, interoperability

Zlodo
Nov 25, 2006
xml does something that everyone needs it and it doesnt really do it well but not badly enough that people bother using something better

if you do small poo poo like some configuration files or serializing a few things its ok. if xml is used for instance as a file format to describe (during development) all the objects making up a large video game's open world and perforce takes one hour to get the latest version of the data and the game take 5 minutes to load you kind of wish a less wasteful format like json had been used

re: schemas you can do schemas in json too

in fact, plot twist: you can even do schema validation on plain text. it's called a "parser" and the schema is called a "grammar". thats another thing with xml, people seem to literally believe that you can't do cool data manipulation on structured data represented in any other way than tags in angle brackets

X-BUM-RAIDER-X
May 7, 2008
i did json schema validation once but it was one of those things where you don't rly know what schemas will be harder to validate or maybe you do but I didn't care at the time because we decided it was too expensive anyway

Shaggar
Apr 26, 2006
theres no such thing as json schema only custom instructions for custom parsers. xml schema is a defined standard

Notorious b.s.d.
Jan 25, 2003

by Reene
we had this discussion earlier, like 100 pages ago. i'm just gonna give the main points here
  • json schemas are non-standard.

  • json itself is nonstandard, parsers vary in strictness

  • interoperability matters. every language/platform has a parser generator library but i don't want to port my fuckin grammar to every platform's parser generator and hope i didn't create subtle bugs

serialisation and deserialisation is one of those things people like to pretend is easy
but it's not

Notorious b.s.d.
Jan 25, 2003

by Reene
having a well-specified standard means that when i want to interoperate with a french mainframe, an american minicomputer from the 1970s, and a japanese warehouse running Windows, i'm gonna use xml

i really don't want to hack up my own agreed standard around french-codepage EBCDIC and windows shift-jis json

Salynne
Oct 25, 2007

Socracheese posted:

please inform my scrub brains, i have only used xml in situations where json would have also worked, wat can it do that json cannot

this was me as well so thanks for these posts about why xml owns

Zlodo
Nov 25, 2006

Notorious b.s.d. posted:

having a well-specified standard means that when i want to interoperate with a french mainframe, an american minicomputer from the 1970s, and a warehouse running Windows, i'm gonna use xml

ah yeah clearly a typical day-to-day use case for most people

Shaggar
Apr 26, 2006
yeah that's kind of the whole point of serialization.

Zlodo
Nov 25, 2006

Shaggar posted:

yeah that's kind of the whole point of serialization.

yeah you clearly never need serialization in a context that doesnt involve heterogenous systems

Tiny Bug Child
Sep 11, 2004

Avoid Symmetry, Allow Complexity, Introduce Terror
i agree with you guys. xml is only better when you have to work with dumb stuff that doesn't parse json right.

Socracheese
Oct 20, 2008

so basically the only reason xml is better than json is because json is a lovely standard?

Notorious b.s.d.
Jan 25, 2003

by Reene

Zlodo posted:

ah yeah clearly a typical day-to-day use case for most people

yes it is a completely typical day-to-day use case

or have you never shopped in a retail store
or driven a car
or used a product manufactured in a country other than the u.s.

most code in the world isn't consumer-facing webapps written by startup wunderkinds. it's awful vile data processing to manage business processes

Notorious b.s.d.
Jan 25, 2003

by Reene

Socracheese posted:

so basically the only reason xml is better than json is because json is a lovely standard?

yes.

Police Academy III
Nov 4, 2011
so a guy at work was unironically pushing for us to switch our javascript to dart. looking at the wiki page it doesn't look terrible if not very exciting, basically like the web version of go. has anybody actually used it or looked at it or given a poo poo about it? or is it just gwt 2.0?

Shaggar
Apr 26, 2006

Zlodo posted:

yeah you clearly never need serialization in a context that doesnt involve heterogenous systems

in that case a custom binary format would be faster

Zlodo
Nov 25, 2006

Notorious b.s.d. posted:

yes it is a completely typical day-to-day use case

or have you never shopped in a retail store
or driven a car
or used a product manufactured in a country other than the u.s.

most code in the world isn't consumer-facing webapps written by startup wunderkinds. it's awful vile data processing to manage business processes

i don't remember having to personally deal with data serialization and validation last time I shopped at a store, drove my car or used a product??? I think you might be doing those things wrong

Zlodo
Nov 25, 2006

Shaggar posted:

in that case a custom binary format would be faster

shaggertef was right

Adbot
ADBOT LOVES YOU

Dessert Rose
May 17, 2004

awoken in control of a lucid deep dream...

Zlodo posted:

shaggertef was right

  • 1
  • 2
  • 3
  • 4
  • 5
  • Post
  • Reply