-
Notifications
You must be signed in to change notification settings - Fork 219
pretty printing support for json formatter #243
Conversation
Nice one. I think it would be cleaner if we passed a boolean instead of a map. The map only ever contains a WDYT? |
Well, we could pass just boolean, but hash allows us add more params later w/o changing interface. |
What more parameters do we need? |
Right now |
I prefer not to speculate what we might need in the future and make it more complicated just in case we need something. DTSTTCPW ;-) |
As a reader of the client code, I find the named argument more readable than just a true/false. It would be nice to preserve this readability somehow if we change the API to use a Boolean. |
@mattwynne I agree: named arguments are more readable. |
Is there something about this method that makes it less readable than any other method using normal arguments?
The caller has to read the implementation, and if he accidentally passes a map where the value is not a Boolean, he'd get a ClassCastException. It's also not very idiomatic Java. I think the simplest thing to do in this case is to not add an extra argument at all - just always make pretty JSON. Minified JSON only makes sense when it's really big and it's sent over the wire. That's not the case here. |
I like this idea. |
On 16 Mar 2013, at 10:04, Oleg Sukhodolsky [email protected] wrote:
|
Ok, then I will implement this. |
This changes are needed for for cucumber/common#197