Greenwashing

Paolo Invernizzi paolo.invernizzi at gmail.com
Thu May 28 07:36:05 UTC 2020


On Thursday, 28 May 2020 at 01:23:31 UTC, Steven Schveighoffer 
wrote:
> On 5/27/20 8:31 PM, Jonathan M Davis wrote:
>> On Wednesday, May 27, 2020 5:57:00 PM MDT Meta via 
>> Digitalmars-d wrote:
>>> On Wednesday, 27 May 2020 at 18:50:50 UTC, Jonathan M Davis 
>>> wrote:
>>>> Based on some of Walter's comments, it also sounds like he
>>>> intends to make nothrow the default in another DIP, which is
>>>> also a terrible idea. I'm increasingly worried about the 
>>>> future
>>>> of D with some of where these DIPs are going.
>>>>
>>>> - Jonathan M Davis
>>>
>>> What's wrong with nothrow by default? Probably 97% of code
>>> doesn't need to throw exceptions.
>> 
>> If anything, I would say the opposite.
>
> It actually doesn't matter what's more common (and I agree with 
> Jonathan, there's actually a lot of throwing calls because of 
> the calls that you make into other functions). What matters is 
> that there are functions that are actually nothrow that aren't 
> marked nothrow. Hence the desire that these functions should 
> actually be marked nothrow implicitly so people who care about 
> that can just use the functions without issue.
>
> -Steve

What make me feel "mhmm" is that the motivation is always 
"because no throw is speediest, so should be the default" ...

While I'm ok the "pay as you go" concept, I still think that a 
sane default for writing good code is still preferable: tuning 
the hot path is still the way to go if you care for speed.

The same for switching from "virtual by default" to "final by 
default", the motivation should not be "because the code is 
speedier", but because it's the best way to promote encapsulation 
of the class public API (as W&A agreed years ago ...)

The same for safety, if you don't care, well, slap @system 
everywhere, or @trusted if you want, anyway you are not caring. 
You just CAN code fast in that way. BUT if you care, you should 
have all the aid from the compiler to archive it, because writing 
@safe code is much more task, so @safe only for compiler checked 
code.





More information about the Digitalmars-d mailing list