MoaidHathot / Dumpify

Adding `.Dump()` extension methods to Console Applications, similar to LinqPad's.
MIT License
959 stars 40 forks source link

DumpifySettings class? #24

Open dyster opened 6 months ago

dyster commented 6 months ago

Having just tested the MembersConfig options, i ended up with myObject.Dump(null, null, null, null, null, null, membersConfig); Would Dump benefit by a DumpifySettings class similar to XmlSettings and others used in .NET?

Yes I know there is the global setting =)

MoaidHathot commented 6 months ago

You can use named-parameters :)

myObject.Dump(members: membersConfig);

Having said that, I'm rethinking the current strategy for customizing the Dumps. It isn't ideal to say the least.

dyster commented 6 months ago

That's hilarious, I remember when they introduced named parameters like 15 years ago but I didn't really understand what it was for when I read it in the release notes and never gave it a second thought. And here we are, I finally figured it out haha.

I don't know if the Microsoft serializers way of having a SettingsObject is the best way of doing it, but once you get used to it you are used to it, and when some nuget I just got is also using a settings object of some sort I hardly ever think twice about it, so I think it makes sense from that perspective.

I think one thing I like about the settings object is that without having to browse code or look online, you can just instantiate it and inspect what all the default values are.