std.serialization: pre-voting review / discussion

Tyler Jameson Little beatgammit at gmail.com
Tue Aug 20 08:07:37 PDT 2013


On Tuesday, 20 August 2013 at 13:44:01 UTC, Daniel Murphy wrote:
> "Dicebot" <public at dicebot.lv> wrote in message
> news:luhuyerzmkebcltxhgjj at forum.dlang.org...
>>
>> What I really don't like is excessive amount of object in the 
>> API. For example, I have found no reason why I need to create 
>> serializer object to simply dump a struct state. It is both 
>> boilerplate and runtime overhead I can't justify. Only state 
>> serializer has is archiver - and it is simply collection of 
>> methods on its own. I prefer to be able to do something like 
>> `auto data = serialize!XmlArchiver(value);`
>>
>
> I think this is very important.  Simple uses should be as 
> simple as
> possible.

+1

This would enhance the 1-liner: write("file", 
serialize!XmlArchiver(InputRange));

We could even make nearly everything private except an 
isArchiver() template and serialize!().


More information about the Digitalmars-d mailing list