`

program experience conclusion

 
阅读更多

1. check parameters for validity

 

To summarize, each time you write a method or constructor, you should think
about what restrictions exist on its parameters. You should document these restrictions
and enforce them with explicit checks at the beginning of the method body.
It is important to get into the habit of doing this. The modest work that it entails
will be paid back with interest the first time a validity check fails.

分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics