3 ms·
> "In most languages, you have "private"" And then you get "I hacked the headers to expose your private variable, and now my program is broken, help!" Back wh
by potatolicious 3y ago
> "In most languages, you have "private""
And then you get "I hacked the headers to expose your private variable, and now my program is broken, help!"
Back when I did a lot more Objective-C you'd have programmers that figure out your private APIs and custom craft invocations to it. Yay.
It feels like getting programmers to code to API contracts, instead of observed behavior, is just one of the toughest things out there...
- hughesjj 3y ago> "I hacked the headers to expose your private variable, and now my program is broken, help!" Normalize closing stuff like this without further discussion as far as I'm concerned "Don't do that." </resolved>
- MattPalmer1086 3y agoHaha, I have certainly done this in the past. I used to get frustrated no end when access to some internal function or variable was exactly what was needed to make things actually do what I needed. The alternative being write the entire thing from scratch. I have learned from this experience to try to make my own stuff safe to extend without needing to access genuinely internal stuff, but it's a lot of work to achieve that level of flexibility. I can see why people generally don't bother.
- extraduder_ire 3y agoEven if it's usually a terrible idea, I quite like how formal objective-c and swift make doing this with extensions/categories. Subclassing would probably be easier to read, but extensions sure beat the hell out of whatever hacks someone would come up with to add a method to the String class.
- yjftsjthsd-h 3y agoI've been told that Windows intentionally destabilizes the syscall interface so you have to use the official dll interface and can't just make kernel calls yourself. I wonder if there isn't something to that.