[swift-evolution] [Review] SE-0006 Apply API Guidelines to the Standard Library
glessard at tffenterprises.com
Wed Jan 27 10:27:49 CST 2016
> On 27 janv. 2016, at 01:48, Dave Abrahams via swift-evolution <swift-evolution at swift.org> wrote:
> Sort of, sort of not. It happens that sometimes you can't tell that the
> precondition is violated until sometime late in the function. So it may
> be a surprising place to see the word "precondition," but it still can
> be a precondition check.
I thought I described a postcondition!
>> I am skeptical of “term of art” as a justification, because it is
>> nearly a synonym of “jargon”, and that is not a good thing.
> It *is* a synonym for "jargon," which is neither a good nor a bad thing.
> Jargon exists for a reason: to allow us to communicate precisely about
> topics in specialized domains. Can you imagine where we'd be if doctors
> couldn't use medical jargon to describe symptoms and procedures?
Jargon keeps non-specialists out: it degenerates into a tool of non-communication. Its use should be weighed by necessity and usefulness. Jargon can accelerate communication among specialists, but to avoid it when it when communicating with others doesn’t mean one can’t think clearly.
Back to `precondition`: I have used the function since the beginning, and think the change to `require` is positive. There is nothing essentially different between `assert` and `precondition`, other than the compiler mode under which they get elided. Either can be used to evaluate whether a specified precondition is met: it’s a choice of safety level. (Eiffel uses the keyword `require` to express preconditions in code; clearly it has precedent.)
More information about the swift-evolution