|
|
|
|
|
by jcelerier
370 days ago
|
|
> After this experience, I consider it an absolute requirement to have a real "private" struct member facility in a language. I think that's the wrong take to have. Life is much easier when you accept the reality of a world where people will do whatever they want with what you give them. C++ has private, and so what? I've seen #define private public or even -Dprivate=public, I've seen classes with private implementation detail reimplemented with another name and all fields public & then casted, I've seen accessing types as char arrays and binary operations to circumvent this, I've seen accessing the process raw memory pages.
If someone other than you can call the code, it's not yours anymore to decide what can be done with it. What you don't owe anyone is the guarantee of things working if people stray from the happy path you outline - they want help after going astray, give them your hourly rate on fixing their mistakes. |
|