@
shiny 主要是我用 PHP 一般都是调用或改现成的>.<
借用一段 Q&A 回复这个问题吧,来源:
http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2014/n4172.htmObjection #1: This feature caters to having functions with many parameters - a programming style that should be discouraged.
We agree that having functions with many parameters should be discouraged. However, the reality is that many legacy APIs that programmers have to work with and will have to work with for a long time, have functions with many arguments, and making it easier to deal with such functions would solve a real problem and be materially useful.
More importantly, however, this feature has a lot of value for functions with few arguments, too. Even for functions with few arguments, when reading a call site one has relatively little information about the roles of the arguments. Having names of arguments present would make call sites more readable, regardless of the number of arguments.