Does D have too many features?

Nick Sabalausky SeeWebsiteToContactMe at semitwist.com
Sun Apr 29 12:30:48 PDT 2012


"deadalnix" <deadalnix at gmail.com> wrote in message 
news:jnhopd$gi3$1 at digitalmars.com...
>
>  - out arguments. We can return tuples, out argument is going backward in 
> history.

You can overload on out parameters. You can't overload on return type. So 
without "out" making an optional output param would be harder to make and 
uglier to use. That could be even more of a problem if the out param in 
question is expensive to compute.

Also, out is nice when interfacing with C. Returning tuples wouldn't help 
here.

I do agree that maybe we should *prefer* returning tuples over out params 
(at least once we kill off the useless comma operator and have a concise 
built-in syntax for tuples), but I don't think tuples are enough to replace 
out entirely.




More information about the Digitalmars-d mailing list