Conversation started Sep 6, 2012 at 15:47.
Sep 6, 2012 15:47
so give me a good reason why XML is bad?
Xeo
Xeo
too much boilerplate
it's verbose and slow as fuck
and for what actual advantage?
meta data
supposedly
@Neil That actually doesn't sound like a bad idea.
@TonyTheLion supposedly? We talking about the metaphorical equivalent of the unicorn here?
Sep 6, 2012 15:49
PerformanceManager.setPerformance(PerformanceManager.MAXIMUM_PERFORMANCE);
Someone came up with this joke here.
@TonyTheLion What's the use case?
the implementation sucks cock, but the idea as a whole isn't bad
@R.MartinhoFernandes config
@DeadMG It was a mess. We had to update an SQL script which would insert records in the database in order to use the classes we made
I mean, he's effectively storing a function in his database
@TonyTheLion Terrible.
Sep 6, 2012 15:49
@R.MartinhoFernandes but INI files aren't much better?
or are they
You expect users to configure stuff by messing with XML in a text editor?
@TonyTheLion yaml to the rescue for config files
> Exercise: This exercise is undefined.
@DeadMG best exercise EVAR
@TonyTheLion Better property files. name=value
Sep 6, 2012 15:50
@kbok Maybe if your users are programmers.
You can't go wrong with that
@Neil yea, seems simple enough
I prefer Lua scripts.
for config?
I mean, the language was originally invented and intended to serve as configuration
simple easy syntax and semantics
Sep 6, 2012 15:51
oh
@R.MartinhoFernandes If your users can't handle a yaml file, they can't handle a text config file altogether.
xml is for structured data
But you don't ask your clients to touch an xml file.. that's like death
Then why should machines deal with that kind of format?
@R.MartinhoFernandes Because there's little room for misinterpretation
Sep 6, 2012 15:54
in PHP, 1 min ago, by dyelawn
Status bar messages explain page details - > Please enable them with javascript < - Safe Christian Site - > Mozilla / Firefox friendly Site for speed. IE loads / sticks more slowly but better graphics < - God Bless you Deeply - > Truly < - In JESUS - > AMEN < - Enjoy !!! ALLELUIA and HALLELUJAH <<<<<<<-------
Oooh, real spam for once.
For structured data, that's always a good thing
@Neil That's not due to XML. That's due to having a well-defined schema for data.
@R.MartinhoFernandes Not for writing an xml, but for reading one
Pretty much all other serialization formats can have that benefit.
so XML is good when you have a machine only reading/writing it and when you have a well defined schema
Sep 6, 2012 15:55
@Neil Same thing. All you need is the reader and writer to agree on a format. It doesn't have to be XML.
@TonyTheLion No, because in that case it's too wasteful and complicated.
@R.MartinhoFernandes True, but like that, it is very inflexible
so XML sucks overall?
Machines don't need to communicate with each other using text.
Xml has the added advantage that you can transform it to any other file type
@DeadMG Dude, your exercises. They basically feel like "To add two numbers, use '+' : '1 + 1' gives '2'. Exercise: calculate pi."
Sep 6, 2012 15:56
@R.MartinhoFernandes SOAP
@Neil Just like any other format! If it contains the data, you can convert it to anything!
@R.MartinhoFernandes Well... there's JSON?
Xeo
Xeo
@kbok lawl
@TonyTheLion You think that's good?
@kbok Which one did you come across now?
Sep 6, 2012 15:56
@R.MartinhoFernandes no, but it uses XML for two nodes (machines) to communicate
I tuned a lot of them down
@R.MartinhoFernandes You'd need a specific program to do it. For xml you just need an xml transformer and any xml file basically
@TonyTheLion and that's bad
@DeadMG "Exercise: What are the semantics of reading a string from std::cin?"
Sep 6, 2012 15:57
also, WCF has tons of XML
@TonyTheLion IMO, the biggest problem is that they tried to compromise between human readability and machine readability -- and instead of getting both, they got neither.
You need a specific XML transformer, for sure.
HTML/XML/JSON - are all plain-text I believe
@TonyTheLion Yes, things like that exist, but it doesn't mean they're good.
@R.MartinhoFernandes right
Sep 6, 2012 15:57
Name an advantage of XML or JSON over Google Protobufs for machine-machine transmission.
@DeadMG At this point the reader probably has no idea what "semantic" means
@R.MartinhoFernandes If you wrote a file called "myconfig.cfg" structured however you want, to transform it to, say, an html file, you'd have to build a program to do it
Xml requires a transformation file that can be adapted to handle basically any kind of xml
You also have to write one such program if it's in XML.
Sep 6, 2012 15:58
I thought this code couldn't get any worse! It's using exceptions for flow control!
@Neil A transformation is a program.
XSLT is a programming language.
Xeo
Xeo
@R.MartinhoFernandes The need to convert first or something if you don't have the data read in the protobuf format? No idea :)
@kbok Is not my job to teach English. But, more relevantly, that's just a difficult phrasing, not a fundamentally difficult exercise. All you'd have to do is std::cin a string and see WTF happens, or Google the documentation
It's a program like an xml reader. You don't have to write your own. After you make an html file, you can make a txt file or a doc file
you don't have to write it from scratch
@Xeo How do you do if you don't have the date in XML format?
@Neil Same with Google Protobufs.
Sep 6, 2012 16:00
@R.MartinhoFernandes Maybe, but you were talking about just any old format
Also, an XML reader is a very vague and useless tool.
Just demonstrating xml has its advantages
I'd still prefer simpler formats if I could do that instead though
An XML reader that can read any XML file cannot do much useful with it.
@R.MartinhoFernandes well, a text editor that can comprehend folding tags is nice
Xeo
Xeo
@R.MartinhoFernandes Well, maybe they have? Like, some config stuff. I personally would use JSON in an case, but oh well
Sep 6, 2012 16:01
@DeadMG Then you should explain that instead.
Oh god, real estate agents are such douchebags
Xeo
Xeo
@R.MartinhoFernandes It can make a data tree out of it!
@LuchianGrigore ?
Am I the only one who thinks this is photoshopped?
Sep 6, 2012 16:01
@Xeo I prefer JSON on the web by far
Xeo
Xeo
no
oh right, yeah, totally real
@Neil I'm not certain what you two are debating
@LuchianGrigore highly
@thecoshman Just like a bucket of water is nice in Hell. I don't believe humans should be writing XML in the first place. I'm sure you'll agree it sucks for that.
@LuchianGrigore lol
Sep 6, 2012 16:02
where's Cameron Diaz when you need her?
@LuchianGrigore Pretty sure that the wallpaper doesn't have words written all over it.
@LuchianGrigore Photoshop so bad!
@LuchianGrigore Either 'shopped or very unusual. Obvious example: the clock looks round, but should look oval being viewed at an angle.
@Xeo Right. That's all.
@R.MartinhoFernandes true, but I do sometimes need to read through it. though usually I do just fire it through grep
Sep 6, 2012 16:03
@JerryCoffin the perspective of the couch doesn't match the walls
@MooingDuck @R.MartinhoFernandes sees no advantage in XML format. I'm saying there are advantages, even if very few
If it's data with a known structure, you need to write a program to convert it any other known structure anyway, regardless of format.
@Neil not over json
second :))
Sep 6, 2012 16:03
@Neil Which ones?
@MooingDuck That's not the argument
Xeo
Xeo
@R.MartinhoFernandes And the program can then use that tree. I once wrote an XML parser myself that does exactly and only that (for a C++ exam where we got the data in XML format and had the choice to either write it outselves or use some ready-made XML parser)
couch, the lamp, the picture on the wall... FFS...
Xeo
Xeo
And then used the tree to make build up a network of connected train stations
@R.MartinhoFernandes Is that a subtle argument or a genuine question?
Sep 6, 2012 16:04
As if you're not gonna go there and see half the stuff isn't real
@Neil A genuine question. I missed them.
Or maybe I don't understand that "program exists" one.
@Xeo To do what? It's a tree with meaningless strings.
Xeo
Xeo
@MooingDuck There actually are, error reporting in the case of a broken XML. It can tell exactly where the end tag is missing or something, while it's a bit harder with JSON
@Xeo ah, true. so xml does have an advantage.
@R.MartinhoFernandes Rather than have to write a program to parse your own file, you can use XML parsers which already exist and transform xml files without having to write a custom program
@Neil And those XML parsers give you a tree of meaningless strings.
Sep 6, 2012 16:06
@Neil that also applies to json and protobuffs
@Xeo If it can truly tell you exactly where it's missing, doesn't that prove that the end-tag is 100% redundant?
You still have to build meaning out of them.
@MooingDuck That's besides the point
Xeo
Xeo
@JerryCoffin :)
@JerryCoffin no, because otherwise you'd have no idea what was missing, only that there's an error somewhere
Ell
Ell
Sep 6, 2012 16:06
@R.MartinhoFernandes you would have to build meaning out of a binary format too?
@Ell Obviously. It's not an advantage of either.
@Neil I thought that was his point. xml vs protobuffs for machine-to-machine
@Neil The problem is that in most cases, interfacing to an exising XML parser is more work than parsing a sane format on your own.
@R.MartinhoFernandes There are xml parsers that have type support, but in any case, that would be the same if you read a string from a file
Protobufs have type support too (they're built around it, actually). That's not an advantage of XML
Sep 6, 2012 16:07
@MooingDuck Why would I claim protobuffs or json is better than xml? I use json myself
Ell
Ell
@R.MartinhoFernandes sorry I thought you were implying binary data would automatically have value
Xeo
Xeo
@R.MartinhoFernandes Think so? I don't see how that is true. Or do you mean I need to transform the data anyways, and that I should've transformed from the get-go without building a tree of strings first?
That doesn't bunk the argument that xml has advantages over, say.. nothing at all
@Neil R.Martinho is claiming that, not you
@DeadMG The example for templates is great.
Sep 6, 2012 16:08
@JerryCoffin Sometimes yes, depends on if you're working with structured data
@Neil nobody has disagreed with you about that
@Neil Meh, then this is a meaningless discussion.
Ell
Ell
We knew that already
If it's for humans there are saner formats. If it's for machines there are more efficient and saner formats as well.
@MooingDuck No, he's bashing xml. I'm not going to pretend xml is better than everything
Sep 6, 2012 16:09
The only use for XML is to interface with existing XML interfaces (SOAP web services, for example).
@kbok I think it led in well from the previous example.
@R.MartinhoFernandes So according to you, XML shouldn't exist, but it simply does anyway?
@Neil More or less, yes.
@Neil I think R.Martinho is asking you to show that it's the best at anything at all
Ell
Ell
Sep 6, 2012 16:10
I want YAML with multimaps
Oh, and Protobufs can handle non-tree-like data.
@R.MartinhoFernandes <ALL_THE_THINGS>XML</ALL_THE_THINGS>
@MooingDuck The discussion started without Protobuff or json, hence if you ask "why use xml?" then obviously there is a reason why or it wouldn't exist
Is there something better? Yes. And so?
As I said a while back, it's attempting to compromise, not to be the best at one thing. Unfortunately, it's a lousy compromise that ends up lousy at anything.
¬_¬ stupid typos
Sep 6, 2012 16:11
@Neil There's no reason to prefer XML ever.
@R.MartinhoFernandes other than compatability with existing XML
For every reason you could want to pick it, there's a better tool.
@MooingDuck Right.
Ell
Ell
Personal preference?
@Ell XML=bad is not an uncommon train of thought.
Well I'm home now
Sep 6, 2012 16:12
@Ell That's not a good engineering practice.
And yet it exists.. what a paradox
Ell
Ell
I don't see what's so bad about xml personally
@Neil lots of technical things exist which turned out to be bad ideas
Ell
Ell
Sep 6, 2012 16:13
like c++ :D
@Neil not really, lots of mistakes are made, XML is one of them
@Ell overly verbose is the big thing.
Funny thing is, XML spread like wildfire when it came out first
@R.MartinhoFernandes Sure there is -- to satisfy a buzzword-happy boss, who's 15 years out of date, so he's convinced that XML is "the next big thing". So, you use it simply: <myformat>binary_data</myformat>
and everyone started using it
Sep 6, 2012 16:13
@JerryCoffin heh, yes.
@MooingDuck But can you say there exist technologies that were created to fulfill no reason in particular?
MS went on a mashoosive XML implement all in XML shitty spree
@JerryCoffin :) Sadly the binary data needs to encoded.
@Neil no, they're just terrible at those reasons, and so nobody uses them, because they should not be used, because they are bad.
Ell
Ell
xml has xPath, which I think is neat
Sep 6, 2012 16:14
@MooingDuck Right, my point. XML offered something that nobody else had. Hence, it offers advantages. QED
@R.MartinhoFernandes True -- but base64 (for example) is pretty easy without being horribly inefficient.
@Neil so did FORTRAN
@MooingDuck You say that like you're making a point.
@Neil Maybe you mean it had advantages?
Sep 6, 2012 16:15
@Neil there's no reason to use FORTRAN now other than backwards compatability with existing FORTRAN
Ell
Ell
nobody wants to talk about xpath? :'(
@R.MartinhoFernandes The technology hasn't changed, so its advantages haven't changed.
@Neil Not really. Everything XML offered already existed (e.g., S-expressions), but the people who advocated it didn't recognize those pre-existing solutions or the fact that they were doing nothing new.
@Neil it's been replaced
@Neil They became irrelevant, superseded.
Sep 6, 2012 16:16
The whole discussion is centered around "Why use XML? It doesn't have advantages." I have proven they have advantages. That's all I'm after. Not saying you'd prefer XML
I guess XML comes from a time where people thought that complexity was a good thing.
how long has XML been around?
@ereOn to a point it is.
@Neil You haven't shown a single strong reason to use XML (and ironically, I have).
@Neil you've shown that it has advantages over nothing at all
Sep 6, 2012 16:17
if you are the only person in your company who understands how a complex system works, they are not going to hurry to get rid of you
@TonyTheLion 9999999999 nanoseconds
@R.MartinhoFernandes Sigh, see above. I'm not trying to show why you should use XML. Stop putting words in my mouth.
@thecoshman: Well, that also prevents any promotion.
Ell
Ell
@TonyTheLion xml has never been round. it uses <angled> brackets ;)
@MooingDuck Actually Fortran is probably more excusable than XML. In practice, it's really hard to find another language that can match Fortran for raw speed in its area. C++ is about as close as you can get, and even Intel's C++ compiler is still slower than (for an obvious comparison) Intel's Fortran compiler.
Sep 6, 2012 16:17
@ereOn means you can kick back and take it easy
@Neil "Why use XML?" seems like that to me.
security through obscurity
@thecoshman: I did that the past 2 years. Turned out to be boring.
Ell
Ell
@JerryCoffin I wonder what makes fortran so fast. i didn't think you could get any closer to the metal than what c++ produces
@ereOn yeah it kind of is :(
stupid open plan, can't slack of properly
Sep 6, 2012 16:18
@Ell Better aliasing prevention.
@JerryCoffin so you're saying that FORTRAN has more reason to exist than XML, and yet I've never met anyone who still does FORTRAN...
@Ell Big advantage over C++ is lack of aliasing, which makes enregistering much easier/more effective.
@Ell no recursion or aliasing (origionally)
Ell
Ell
hmm I don't know what aliasing is.
@MooingDuck Exactly.
Sep 6, 2012 16:19
Q: Why use XML?
A: To interact with existing XML interfaces.
Not
Q: Why use XML?
A: Because it can do stuff in a mediocre manner.
Nor
Q: Why use XML?
A: Because it filled a hole years ago.
@R.MartinhoFernandes If your plane crashes in the middle of nowhere and all you have to eat are saltine crackers. Despite being tasteless and generally unappetizing, you cannot deny that it still offers a reason to be eaten.
XML is everywhere. So are Java and PHP. And I bet no one here will say the last two are a good thing.
@MooingDuck I know some people who do. Legacy systems in banks and medical institutions.
Just because you don't want to eat saltines if you have another choice doesn't mean saltines have zero value
@Ell Basically, it's the idea that one variable might change another, so you cannot cache reads and writes to them.
Sep 6, 2012 16:19
@Neil All I have to eat is not XML. That's what makes XML worthless.
you'll need a code sample
@Ell two pointers point at the same thing, or overlapping regions
Ell
Ell
@ereOn I like java :P
New topic proposal: All your codes are belong to us!
I had to help a friend of mine the other day, she was writing a python wrapper for an old fortran library
Sep 6, 2012 16:20
@Ell: Just to piss me right ?! :p
@Ell If I have something like f(int *, int *);, the pointers might point to the same memory, so when I write via one, I have to read from memory via the other, in case what I just wrote happens to be the same data. Without that, I could save it in a register instead.
Ell
Ell
@ereOn No, I actually like it :L orr maybe it's the JVM. don't know.
@R.MartinhoFernandes I see you're never going to get my point
@Neil But you can't eat XML
Ell
Ell
Sep 6, 2012 16:21
Ahh I understand aliasing
room topic changed to Lounge<C++>: Are you pondering what I'm pondering? [c++] [c++11] [c++-faq] [pinky]
in this case, *one can't be cached, because it might be the same as two. If it is, and I cached it, I'd change the behaviour of the program.
@Ell I can't blame you. A lot of my friends do and... well they are still my friends :)
references are much better at this
Sep 6, 2012 16:22
@Neil What is it? That if I have no choice but to use XML it has advantages?
any way, I've sat around for an extra hour :P time to go home
@Neil It would be easier to get if you actually had one.
peace out!
JSON is way simpler and its logic is simple to implement (especially compared to XML's one) but I haven't seen any decent implementation of a JSON parser/producer in C++.
Ell
Ell
@thecoshman bye now :)
Sep 6, 2012 16:22
@R.MartinhoFernandes his point is that XML is better than nothing at all
 
Conversation ended Sep 6, 2012 at 16:22.