Algorithms should be free from rich types

bachmeier no at spam.net
Fri Jun 30 14:41:00 UTC 2023


On Friday, 30 June 2023 at 11:07:33 UTC, Atila Neves wrote:

> API design is indeed hard. Which makes it all the more 
> imperative to not accidentally design one with implementation 
> details that users downstream start depending on. That is: API 
> design needs to be a conscious opt-in decision and not "I guess 
> I didn't think about the consequences of leaving the door to my 
> flat open all the time and now there are people camping in my 
> living room".

Private is more like locking everyone else's doors for their own 
safety. In the cases that it keeps an intruder out, it was 
helpful to them. When grandma had to sleep on the sidewalk, not 
so much. Many times library authors have prevented me from doing 
my work because of arbitrarily preventing access to 
implementation details. I should have the option to override 
those decisions. If something blows up, or if my code gets broken 
in the future, it's my fault, because I was the one that made 
that decision.


More information about the Digitalmars-d mailing list