When the CheckObject object has many attributes, the entire function body is too long, which affects the reading of the code. In the second method, each attribute of the object is a method, which is short and concise, highly readable, and the code logic is the same. Of
When the
CheckObject
object has many attributes, the entire function body is too long, which affects the reading of the code. In the second method, each attribute of the object is a method, which is short and concise, highly readable, and the code logic is the same. OfI don’t feel that the second one has any obvious advantages. I like the first one, or else the second one should be changed like this