@jkb

I'm beginning to think that some rationnailsation for old c++ users that can't test privates in a clean way so they decided it was bad practice actually.

Follow

@Ambraven @jkb@octodon.social For a properly designed type, if a method preserves the invariant it should be public, therefore private methods do not preserve it. Unit tests should verify and document invariants, not specific ways in which some intermediate step in the implementation happened to break them. This might not seem generally applicable, only because crippled (invariant preserving private methods) and leaky (invariant breaking public methods) interfaces are common place and standard practice.

· · SubwayTooter · 0 · 0 · 0
Sign in to participate in the conversation
Qoto Mastodon

QOTO: Question Others to Teach Ourselves
An inclusive, Academic Freedom, instance
All cultures welcome.
Hate speech and harassment strictly forbidden.