4 ms·
Ruby, despite having 4? sigils as scoping operators, pervasively screws up or simply doesn't have support for scoping. It really should have support for having
by blasdel 18y ago
Ruby, despite having 4? sigils as scoping operators, pervasively screws up or simply doesn't have support for scoping.
It really should have support for having class modifications scoped to your module (and accessible manually from outside), but I couldn't find it.
If the language is such that everything "should" be a method on the broadest-possible class, people are going to monkeypatch, because it feels "wrong" otherwise. People just want to write idiomatic code.
In Objective-C this ends up not being an issue, because there's very little usage of non-Apple libraries -- plus the default way of adding methods doesn't allow replacement, and Apple libraries are well-versioned (if you build your app for >10.4, API changes in 10.5 are invisible).
- akkartik 18y ago_why's done some work on this: http://github.com/why/potion/tree/master http://github.com/why/potion/tree/master Scoped mixins. Basically, you can modify object behavior within a scope. So changes to core classes can be localized. ++ INCOMPLETE ++
- hboon 18y agoDo you mean to say the default way of adding methods to existing Objective C classes can't replace existing methods? That's not true. I just hit it recently. Subtle bug.