[swift-evolution] Make non-void functions @warn_unused_result by default

Dmitri Gribenko gribozavr at gmail.com
Wed Mar 2 03:52:01 CST 2016


On Wed, Mar 2, 2016 at 1:32 AM, Tino Heth <2th at gmx.de> wrote:
> One simple question that hasn't been answered by anybody yet:
> When a library is used by someone without even basic understanding of it (like knowing about return values), do you really think a warning will enlighten that developer?

There is no evidence that such errors are introduced exclusively by
people who don't understand what they are doing.

If we accept the argument about incompetence, then we can reach a
conclusion that we don't need any safety features in the language,
because competent people who think before typing "obviously" wouldn't
make those mistakes.  But from experience we know that this is not
true, and experienced developers get huge benefits from memory safety,
type systems, automatic memory management etc.

Dmitri

-- 
main(i,j){for(i=2;;i++){for(j=2;j<i;j++){if(!(i%j)){j=0;break;}}if
(j){printf("%d\n",i);}}} /*Dmitri Gribenko <gribozavr at gmail.com>*/


More information about the swift-evolution mailing list