Spell checking errors can be hilarious

Andrei Alexandrescu SeeWebsiteForEmail at erdani.org
Tue Oct 13 13:13:20 UTC 2020


On 10/12/20 3:35 PM, Walter Bright wrote:
> On 10/12/2020 10:04 AM, Ali Çehreli wrote:
>> Of course, a better thing would be to suggest importing std.conv like 
>> some other error messages do.
>>
>> The unfortunate thing in the video was 'to' is not searchable on the 
>> internet and it took them a long time to figure out how to use a 
>> to!string expression. :/
> 
> This is more of a naming problem. "to" as a major name in Phobos is 
> always going to be hopelessly ungreppable.

git grep '\Wto!'

yields the uses.

git grep '\Wto('

yields the definitions.

> Though it could be added to 
> the special list of names importHint().
> 
> "Yes" and "No" are also poor names, the latter is hopelessly 
> ungreppable. Furthermore, they are just redundant to "true" and "false". 
> They never should have been put in Phobos.

git grep '\WNo\.'

yields the uses.

Flag, Yes, and No were introduced to avoid this antipattern:

https://www.informit.com/articles/article.aspx?p=1392524

https://medium.com/@amlcurran/clean-code-the-curse-of-a-boolean-parameter-c237a830b7a3

https://understandlegacycode.com/blog/what-is-wrong-with-boolean-parameters/



More information about the Digitalmars-d mailing list