when implementing a method, I always worry that the incoming parameters are illegal, but I don"t want to write a check because it"s redundant.
A simple function, a few lines of things, write a bunch of checks, and the method becomes older. And a row of methods, each with a bunch of validated if else, at the beginning, looks ugly, doesn"t it?
not to mention method nesting calls, A call Bmai B calls C Magi C call D, if each of these four methods write parameter verification internally, wouldn"t it be a waste of resources after four times of verification?
so there must be trade-offs, or norms and principles.
I would like to invite the bosses to talk about the principles in this respect. Thank you very much.