[Swift-devel] New built-in system, request for comments

Mihael Hategan hategan at mcs.anl.gov
Sat Apr 5 20:56:03 CDT 2014



On Sat, 2014-04-05 at 20:11 -0500, Michael Wilde wrote:

> Regarding treating function failures like app failures: I dont think 
> thats good in the case of functions.  

I am of the relatively strong opinion that we should not make it easy to
overlook errors. The c style errno or the bash style $? are not what I
consider in line with best language design practices, and most languages
past 1990-ish have dealt away with that scheme. The reason is that it is
very rare that an ignored error is intentional. It is more likely the
result of a problem that should be caught sooner rather than later.

I do though think that we should have exceptions. I believe they are the
clean way to address this issue.

Also, I would like to note that all current functions (and pretty much
everything in swift) fail on failure instead of returning some magic
value. System() would be the only exception.

Mihael




More information about the Swift-devel mailing list