Hacker News new | past | comments | ask | show | jobs | submit login

I used to use XML, until i finally got around to learning how to write parsers myself. Atthat point the lightbulb went on, and I realised that I could produce formats that are much easier for humans to read/edit, much smaller, and much quicker for the parser to analyse.

XML knows nothing about the structure of your data. This is intended, but it means that you have to describe the structure of the data along with the data. Seeing as the software that is going to use the XML has to know about the stucture anyway,if it is going to do anything useful, this just means that you end up specifying the structure in the software and in the XML. Blech!

Go and read up on what yacc and all of its decendants can do for you. It'll open up worlds for you :-)




I've done both, and I regret the mini-parsers I wrote. It was for stupid stuff, like config files. The main problem is that nobody else could do anything with the code. XML is at least a common denominator. Not the lowest, but pretty low. :)

I've found it easiest to deal with xml in a very focused way. In my case, I always define a schema and use a code generator to get things in/out of memory. From there on, I don't care about the xml anymore. This is fast and reliable. The only real downsides are (a) ugly xml syntax, and (b) having to remember how XSD works every time.

Where I really object to XML is as an internal construct in a system. It's useful for putting things on disk, and it's useful for interchange with damn near anybody because of the ubiquitous libraries. But you don't want to be keeping your core application state in a DOM. Or using it as an inter-component interface. I've seen more than one person do that, and it made me very sad.




Consider applying for YC's Summer 2025 batch! Applications are open till May 13

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: