>>42
It can get really messy. Imagine having N objects, M internet protocols, and D database formats. For each object, protocol, and data base format, and reading function and a writing function will need to be implemented. Now what if you have to add a field to an object? You have to update the reading and writing function for each serialization method for the object. Errors are inevitable, and inconsistencies will arise between the methods. And besides, it is perfectly easy to just automatically generate them all. This is a case where the computer can do a better job than a human. Just give one specification of an object, and have the computer echo the representation to everywhere it is needed. People aren't good at keeping duplicate records consistent. Computers are experts at it.
Not to mention, sometimes an object needs to be implemented and used between multiple languages. In this case, the only way to have a unique definition of the object is to use code generation.
>>47
I'd ask you to do it, but I don't think you would respond positively. And I'd provide a quick implementation using python, but I don't feel like it, and I'll instead let someone else provide an example.
This technique can be used with C++ you know. You shouldn't feel any reason to question or attack it in the name of C++. I was just saying that I could use it in combination with C to do anything and more, that can be done in C++ alone.