Application settings
Timothee Cour via Digitalmars-d-learn
digitalmars-d-learn at puremagic.com
Sat Jul 8 14:08:03 PDT 2017
I use protocol buffers (using dproto) for this, storing my settings in
either text or wire format. Advantages: type-safety with fwd/backward
compatibility (unlike json which requires dynamic field access, eg
with dproto you get errors at compile time instead of runtime),
supports comments (although can be done w preprocessor on json config
file), supports more types than json (especially binary without
needing to base64 encode).
On Sat, Jul 8, 2017 at 11:35 AM, Seb via Digitalmars-d-learn
<digitalmars-d-learn at puremagic.com> wrote:
> On Saturday, 8 July 2017 at 05:00:45 UTC, bauss wrote:
>>
>> On Friday, 7 July 2017 at 22:52:22 UTC, FoxyBrown wrote:
>>>
>>> On Friday, 7 July 2017 at 20:45:36 UTC, Moritz Maxeiner wrote:
>>>>
>>>> On Friday, 7 July 2017 at 19:40:35 UTC, FoxyBrown wrote:
>>>>>
>>>>> [...]
>>>>
>>>>
>>>> "best" always depends on your specific use case. I use json files via
>>>> asdf [1]
>>>>
>>>> [1] https://github.com/tamediadigital/asdf
>>>
>>>
>>>
>>> Seems like quite a heavy package for what I need. I just want to write a
>>> AA to disk and load it, ultimately.
>>
>>
>> Then I would go with INI, because you'll ultimately just have key-value
>> pairs.
>>
>> https://code.dlang.org/packages/baussini (Pretty old but should still work
>> just fine.)
>
>
> There is also inifiled: https://github.com/burner/inifiled (used for
> Dscanner for example)
More information about the Digitalmars-d-learn
mailing list