Greenwashing
Andrei Alexandrescu
SeeWebsiteForEmail at erdani.org
Thu May 28 22:43:29 UTC 2020
On 5/28/20 9:42 AM, Joseph Rushton Wakeling wrote:
> On Wednesday, 27 May 2020 at 23:57:00 UTC, Meta wrote:
>> What's wrong with nothrow by default? Probably 97% of code doesn't
>> need to throw exceptions.
>
> One point of view can be to consider the consequences of fixing code
> that incorrectly uses the default.
>
> If we have throws-by-default, then marking an existing non-templated
> method `@nothrow` is not a breaking change.
>
> If we have nothrow-by-default, then marking an existing non-templated
> method `@throws` is a breaking change.
>
> Another point of view could be that there's a benefit to being
> permissive by default in terms of what the developer can do.
And that should be a breaking change. So all is good.
Changing the regime of a function from nothrow to throw is major.
I'm sympathetic with making functions nothrow the default. The reader
and compiler taking into account the possibility of throwing is a large
upfront tax. That should not be paid without necessity.
More information about the Digitalmars-d
mailing list