> This can be a contentious subject because there's a lot of nuance and the right answer is often context-dependent. But I personally think that the Java style of "we must absolutely protect the library user from themselves and childproof everything" is waaaay too far in the wrong direction.
I tend to agree with this sentiment; especially when the 'child-proofing' means to do the thing right with the library/api in question is more work than just rolling your own.
> I would much rather that a language have mechanisms to clearly communicate "don't touch this unless you have a good reason, but if you need to here's how" rather than saying in effect "you, the person using this library, are dumb and need to be prevented from messing with the library maintainer's perfect vision".
In some cases I've seen/used the term 'Unsafe'.
C# language-ext uses this for some methods that can return null (as opposed to un-Unsafe-suffixed methods, which will throw on null). I've also used it for some 'low level' methods in libraries, where it is a case of 'you need to read the docs to know how to not turn it into a footgun'.
The problem of course is that in my main language (C#), the word 'unsafe' has other connotations (i.e. pointer arithmetic.)
When I first submitted my PR, there were numerous developers who did not like the term 'Unsafe' for the reasons mentioned above. I asked what it should have been called in that context instead, and floated 'Yolo' as a tongue-in-cheek suggestion.
(That being said, If there -was- a word to use to denote 'with great power comes with great responsibility' people would suggest, I'd love to hear it.)
I tend to agree with this sentiment; especially when the 'child-proofing' means to do the thing right with the library/api in question is more work than just rolling your own.
> I would much rather that a language have mechanisms to clearly communicate "don't touch this unless you have a good reason, but if you need to here's how" rather than saying in effect "you, the person using this library, are dumb and need to be prevented from messing with the library maintainer's perfect vision".
In some cases I've seen/used the term 'Unsafe'.
C# language-ext uses this for some methods that can return null (as opposed to un-Unsafe-suffixed methods, which will throw on null). I've also used it for some 'low level' methods in libraries, where it is a case of 'you need to read the docs to know how to not turn it into a footgun'.
The problem of course is that in my main language (C#), the word 'unsafe' has other connotations (i.e. pointer arithmetic.)
When I first submitted my PR, there were numerous developers who did not like the term 'Unsafe' for the reasons mentioned above. I asked what it should have been called in that context instead, and floated 'Yolo' as a tongue-in-cheek suggestion.
(That being said, If there -was- a word to use to denote 'with great power comes with great responsibility' people would suggest, I'd love to hear it.)