Pretty please: Named arguments

spir denis.spir at gmail.com
Tue Mar 1 04:20:08 PST 2011


On 03/01/2011 12:48 PM, Lars T. Kyllingstad wrote:
> On Tue, 01 Mar 2011 12:20:22 +0100, spir wrote:
>
>> On 02/28/2011 11:13 PM, Steven Schveighoffer wrote:
>>>> But I still don't see the need for this feature. Aren't people using
>>>> IDEs where the function signature (with parameter names) pops up when
>>>> you're entering the function, and when you move the mouse over the
>>>> function call?
>>
>> You are wrong Don, this is not an argument. The feature is *not* for
>> writing code, but for reading it (first your own code). Obviously, if
>> you can write parameter names, this means you know them somehow, lol!
>> The names provide highly valuable info at /reading/ time.
>>
>>> Dunno, vim doesn't do that for me currently.  Also, if reviewing code
>>> on github, there is no ide.
>>
>> Geany does it, but only for currently open files. Meaning, to have it
>> work when programming in D, I should have the whole stdlib open in geany
>> tabs... Anyway, as said above, this feature is 'orthogonal' to the
>> question discussed in this thread.
>>
>> I'm fed up with people opposing to features very relevant for code
>> clarity, which they are not forced to use, and can hardly bother when
>> reading code themselves. Is the second statement below really that hard
>> to read?
>> 	p = new Point([1,2,3], [3,2,1]);
>> 	p = new Point(color:[1,2,3], pos:[3,2,1]);
>
> Are the following really that hard to read?
>
>    p = new Point(/* color */ [1,2,3], /* pos */ [3,2,1]);
>
>    p = new Point(
>          [1, 2, 3],    // color
>          [3, 2, 1],    // pos
>          );

Just like the unittest feature is very simple and brings no new functionality 
(you can very easily write unittests w/o the feature), but having them an 
official feature makes it nicer, obvious, and used everywhere.

Denis
-- 
_________________
vita es estrany
spir.wikidot.com



More information about the Digitalmars-d mailing list