3 ms·
Not OP, and I agree that Objective-C is great. However, it is potentially troubling, from a performance standpoint, that practically everything is allocated on
by archagon 12y ago
Not OP, and I agree that Objective-C is great. However, it is potentially troubling, from a performance standpoint, that practically everything is allocated on the heap. There's no support in the language for stack-allocated objects, for example. Now that I've used Swift in production, I also really miss generics. Casting to and from containers gets really annoying and unsafe!
- gurkendoktor 12y ago> practically everything is allocated on the heap It has gotten a lot better thanks to tagged pointers: https://www.mikeash.com/pyblog/friday-qa-2012-07-27-lets-build-tagged-pointers.html https://www.mikeash.com/pyblog/friday-qa-2012-07-27-lets-bui... Objective C is mostly used for UI code, and I think it's a fantastic language for that, with its Ruby-like weak typing and strong metaprogramming capabilities.
- seanalltogether 12y ago"that practically everything is allocated on the heap" That's kind of the point though. If you want something on the stack, you write plain old C structs or work with primitives. There's plenty of this happening throughout the cocoa frameworks. On the other hand, if you find yourself writing C structures to the heap in objc, you're probably wasting your effort.