[quote name='wack' timestamp='1332676418' post='4925085']
[quote name='Eelco' timestamp='1332673834' post='4925084']
[quote name='wack' timestamp='1332672306' post='4925081']
[quote name='Eelco' timestamp='1332670504' post='4925077']
Someone recently asked me if I knew how to do string manipulation in C. I replied: why would I want to know how to clip my nails with a sledgehammer?
This sounds like an analogous situation.
There are so many languages in which things like this are completely painless. If you really must use C(pp) (and there are plenty of good reasons), use it as an extension module to a program written in a language, that will not have you pulling your hair out over such trivial things.
My rule of thumb: if you are writing int main(){} anywhere in your code, you are abusing C++ and doing it wrong.
While that sounds good in theory, my experience is that few things in C++ are difficult enough to warrant the complexities in debugging and glue code that combining multiple languages always involve. My rant is mostly about xerces making things more difficult than they need to be, in any language.
[/quote]
I dunno; not having such libraries be part of the language ecosystem seems like a typical C++ problem, that youd run in time and time again. The fact that there apparently is no sensible library available for C++ is also a testament to its shortcomings as a language.
Coming from a python and .net perspective, the glue code has never been much of a barrier, but I suppose those are the exceptions.
[/quote]
I think neither [s]Pyhton[/s] or C# would help in this case, since as far as I know, both of them only have DOM parsers, no SAX parsers. So it is perhaps Promit is right. It's XML itself that is the problem. Or would you say it's a testament to the shortcomings of C# and [s]Python[/s] that there is no SAX parser?
Edit: it seems python has a SAX parser after all, but calling it from C++ would frankly involve a lot more code than just using xerces.
[/quote]
My point is to not write your high level application in C++; I dont know of your other constraints obviously, so these are more theoretical than practical musings, but if at all possible, id write my main application in python, do my parsing from there (which is probably just a tidy wrapper around some efficient C library), and use boost::python to effortlessly integrate any C++ code that id need to write.
If the python ecosystem does not provide a specific kind of parser, yes id consider that a failure of that languages ecosystem, but of all the languages ive worked with, python has the strongest ecosystem, hands down. Unless you are trying to do something very arcane, id be very surprised if python couldnt do it. A quick google seems to indicate this functionality is in the standard library, even.
[/quote]
Well, let's just say we disagree. I have combined muliple languages many times, and maintained apps where it has been done by others. Almost always you end up regretting and cursing the debugging horror that appears. Most of the time it is better to select one language that has the features you need and stick with it, even if some of the features are better implemented in other languages.