RFC: std.json sucessor
w0rp via Digitalmars-d
digitalmars-d at puremagic.com
Sat Aug 23 05:19:07 PDT 2014
On Saturday, 23 August 2014 at 09:22:01 UTC, Sönke Ludwig wrote:
> Main issues of using opDispatch:
>
> - Prone to bugs where a normal field/method of the JSONValue
> struct is accessed instead of a JSON field
> - On top of that the var.field syntax gives the wrong
> impression that you are working with static typing, while
> var["field"] makes it clear that runtime indexing is going on
> - Every interface change of JSONValue would be a silent
> breaking change, because the whole string domain is used up for
> opDispatch
I have seen similar issues to these with simplexml in PHP. Using
opDispatch to match all possible names except a few doesn't work
so well.
I'm not sure if you've changed it already, but I agree with the
earlier comment about changing the flag for pretty printing from
a boolean to an enum value. Booleans in interfaces is one of my
pet peeves.
More information about the Digitalmars-d
mailing list