I don't have any big preference, but I tend to agree with sawa too.
When I first read the proposal, I was confused in that two suggestions seem to be combined - or at the least I was reading it that way.
(1) Display "foo: bar" rather than ":foo => bar".
and
(2) Using:
'My name is "abc"'
Rather than:
"My name is \"Marc-André\""
Sorry if I misunderstood it initially. I believe that both situations are fine BUT!
I'll soon add what I think may be a problem.
First, let me say that I somewhat agree with vo.x in the sense that the hash rocket
is the "default" syntax for hash, and the foo: :bar is a "shortcut". Note that I use
the foo: :bar notation a lot myself, but ruby even sort of shows you that it is
an alias to the hashrocket rather than the reverse - in IRB:
hash = { foo: :bar, cat: :tom }
hash # => {:foo=>:bar, :cat=>:tom}
So there we have the => notation. And I think this should stay the default too,
similar to what vo.x wrote.
At the same time, though, I think a part of marcandre's suggestion was to have
pp be more flexible in use. So if a ruby user prefers what marcandre suggested,
then I am fine with this. I believe that this should not become the default,
though. The current default should remain, but if people are able to customize
it to their likings, then I am all for it.
How to customize this? Well. Perhaps PP could have a toplevel configuration
style or something; and an option hash for pp() itself. (Toplevel configuration
could then be used to set up PP once.)
I should also say that I know the ap (awesome_print), and it has colour support,
but I realized that the colours confused me more than it helped me, so I went
back to pp. I use pp a LOT. I don't have a really strong opinion per se, but
I think it would be better to default to how things are right now, but allow
people to customize the behaviour of pp (perhaps even at compile time if they
feel strongly about it).
benoit wrote:
I think symbol_key: value would be nice in Hash#inspect, even if there are
also non-Symbol keys.
Well, if people can decide this on their own, then that is fine - but I personally
would rather retain the current behaviour here, for my own projects.