Should out/ref parameters require the caller to specify out/ref like in C#?

Ola Fosheim Grostad via Digitalmars-d digitalmars-d at puremagic.com
Sun May 28 21:57:39 PDT 2017


On Monday, 29 May 2017 at 01:56:19 UTC, Nick Sabalausky 
(Abscissa) wrote:
> On 05/28/2017 03:06 PM, Meta wrote:
>> 
>> If you didn't know that the function takes its parameters by 
>> ref or out... You're should've RTFM.
>
> That's the same reasoning that's been used to excuse just about 
> every API blunder in C's infamously unsafe bug-riddled history.

This is information that a good IDE could be designed to provide. 
To require "ref" is rather pointless as it would make the feature 
redundant, just use a pointer and "&" instead and argue in favour 
of nonnullable static analysis...


More information about the Digitalmars-d mailing list