News for hackers. Stuff that matters.
Re:Better C – A subset of D Programming Language by asdkjh345fd on Wednesday April 29, 2020 @08:04AM (#23018121)
Right, the entire world is wrong because you can't admit a fault in a random piece of software you are emotionally invested in. Makes sense.
Re:Better C – A subset of D Programming Language by aldacron on Wednesday April 29, 2020 @10:37AM (#23019764)
Not quite. I'm saying that in this case it doesn't matter because of the way the API is used. Is it confusing for people who don't understand D ranges? Yes, it certainly can be. It was for me when ranges first came along. But once you understand how D ranges are intended to be used, then you realize you rarely ever care what the return type is. D is not Rust, or C++, or (insert language here).

When the return type actually matters, auto should be avoided unless there's no way around it. But that's why we have "Returns:" in Ddoc. The function signature itself is not the complete documentation. I mean, you're acting like all D functions are documented to return auto. They aren't. It's used where it needs to be.