You know what they say about using a sledgehammer to crack a nut.
It’s bloody stupid, that’s what they say. And, by and large, unless you find yourself stuck on a desert island with only a sledgehammer for company, with a self-inflating liferaft tucked safely away inside an enormous peanut, they’d be right.
Having heard about the wonders of XML from all sides for months - hell, I’d even sampled the delights of XML in C#, where retrieving data is pretty much a one-line chunk of code thanks to the devilry hidden within System.XML - I thought I’d use it to store the runtime settings for my C++ application.
More fool me for spending HALF AN OOOUR trying to wrap my head around the various XML libraries out there. Half an hour? More like two days. They’re vast, overcomplicated and completely ill-suited to doing anything less complex than running a nuclear reactor while juggling XSLT transformations with your eye stalks.
You’re also expected to extend them with reams of your own code before you can even begin to play with them.
Fortunately, before I went completely insane, I had a look around for an alternative. And I found a great one. A C++ class that reads data from a humble .ini file? Invoked with a single line of code?
Exactly what someone should have written for XML.