This isn’t covered by the tour, however it is discussed in the taste of 2.8
You can call methods or create classes using the name in the declaration. You might do this to increase the readability of your code, especially when you may have many arguments to a method or constructor. This also comes into play with DefaultParameterValues.
Note that once you are using parameter names in your calls, the order doesn’t matter, so long as all parameters are named.
My Thoughts on This Feature
In general, I like this concept, although it’s not as baked-in as Objective-C’s way of doing it, and it’s not as flexible as Ruby’s (which amounts to allowing a map literal to be passed as the last argument to a method).
Last Updated 07/16/2010 at 02:31:12 PM by davecblog comments powered by Disqus
Creative Commons Attribution-Noncommercial-Share Alike 3.0 United States License.