The ruleofthumb is that you should use the one method that best matches the collection type the application is waiting for, so that type conversions are avoided.
经验法则是,应该使用与应用程序期望的集合类型最匹配的那个方法,以避免类型转换。
2
For a helpful ruleofthumb, you could say that a method with more than 100 non-commenting lines of code is way too long.
有一个很有帮助的经验法则,您可以说非代码注释行超过100行的方法是长方法。
3
The general ruleofthumb is that if there's more than one try-block's worth of code in a method, then the method is too big and should probably be broken up into smaller methods anyway.