JSON.jl
JSON.jl copied to clipboard
Make `indent` a keyword argument?
Currently, indent is a positional argument for json and print. Personally I think it would read better as a keyword argument:
json(Dict("a" => "b"), 4)
vs.
json(Dict("a" => "b"), indent=4)
I think that makes sense. I think this interface with possibly created before keyword arguments existed. There's always the concern that keyword arguments don't participate in dispatch but I'm not sure how much of a concern that is here.
Also document it in the README, I figured out how to pretty print by reading the tests.
I would be very supportive of doing this - it confused me for a little bit; using a keyword argument seems far more natural in this interface