3 ms·
My biggest beef with Objective C is that it takes the most retarded feature of C++ -- that you have to write both a header and a implementation file (why oh why
by tomjen3 16y ago
My biggest beef with Objective C is that it takes the most retarded feature of C++ -- that you have to write both a header and a implementation file (why oh why can't the compiler compile one?) -- and removes the really nice ability to allocate your object on the stack (which means memory allocation is really, really, cheap and you know when the object is deallocated).
- zoul 16y agoAs for the header/implementation split, I might have been brainwashed by the language, but I like it :) I take it as a nice division between the public interface and private implementation. And now that we have purely synthesized properties in the modern runtimes, we can keep the header file really clean: https://gist.github.com/766381 https://gist.github.com/766381 I have never missed allocating objects on the stack, I am mostly happy with autorelease pools. They are slower and “less deterministic” than stack-based objects, but I don’t mind.
- leon_ 16y agoWell, call me weird but I like the .h/.c split. Header files are awesome for a quick lookup. Big implementation files are not. About the stack ... well if you care about performance to this degree in your Obj-C code chances are you should implement the stuff in C/C++.
- blub 16y agoLet's give credit where it's due - the header/source split is a particularity of C, borrowed both by C++ and Objective-C for compatbility.