为方法参数使用尽可能有意义和清晰的名称被认为是最佳实践:
public myFunction(String meaningfulName1, String meaningfulName2, boolean meaningfulName3)
但是,在调用该方法时,有时我们会发现这一点,这会降低可读性:
myFunction("", "foo", false);
为了清晰起见,是否值得为参数创建变量的开销?
String meaningfulName1 = "";
String meaningfulName2 = "foo";
String meaningfulName3 = false;
myFunction(meaningfulName1,meaningfulName2,meaningfulName3)