D has become unbearable and it needs to stop

FeepingCreature feepingcreature at gmail.com
Thu Jun 15 13:16:55 UTC 2023


On Thursday, 15 June 2023 at 12:35:37 UTC, Adam D Ruppe wrote:
> Option 1: Define its status quo behavior on the spec. If passed 
> an overloaded function symbol, it will return the attributes of 
> the lexically first function in the set. There's nothing 
> actually wrong with that if people know what to expect and how 
> to work with it!

Yeah, hard disagree; or rather: "there's nothing actually wrong 
if people know what to expect and how to work with it" ... *and 
do so reliably*, which is to say that it is terrible. If you 
place a [pit of 
despair](https://blog.codinghorror.com/falling-into-the-pit-of-success/) next to a feature, you should not blame the user for falling into it. The truth is, `getAttributes` *invites* handling overloads wrong, it's a footgun, because you'll probably not be testing it with overloads and unless you choose the right tests, even if you do it will still appear to work correctly, while silently executing a behavior that you probably won't expect and definitely won't notice until a user complains years later when you have long moved on to another project.


More information about the Digitalmars-d mailing list