Forums
New posts
Articles
Product Reviews
Policies
FAQ
Log in
Register
What's new
Search
Search
Search titles only
By:
New posts
Menu
Log in
Register
Install the app
Install
Forums
macOS & iOS Developer Playground
macOS - Development and Darwin
Best programming language for Mac
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Reply to thread
Message
<blockquote data-quote="mystic_fm" data-source="post: 767706" data-attributes="member: 28538"><p>Objective-C is like C++ in that it takes the C language and adds object-oriented (OOP) features to it. However, it is very different from C++ in its implementation of those features (evidently it is closer to Smalltalk, although I'm unfamiliar with the latter). The biggest differences are that Objective-C is a relatively lightweight extension of C when compared to C++, and that Objective-C evaluates messages sent to receivers (approximately an analog to calling a method on a C++ object) at runtime, rather than making those connections at compile time.</p><p></p><p>Objective-C is the preferred language to program Cocoa applications in if you want good performance and are not building a cross-platform app. If you go through Apple's documentation on Cocoa, you'll see that the primary language discussed is Objective-C. Also, you cannot access the Cocoa frameworks directly from either C or C++ ... you would have to use some sort of a wrapper (which would undoubtedly be written using Objective-C).</p><p></p><p>I haven't done any timing, but I'd guess that for standard C constructs, the execution time of Obj-C code is essentially identical to C (and hence somewhat faster than C++). When using the Obj-C extensions, obviously it is going to be a bit slower than straight C code (just as C++ is), but you're getting the benefits of OOP in exchange.</p></blockquote><p></p>
[QUOTE="mystic_fm, post: 767706, member: 28538"] Objective-C is like C++ in that it takes the C language and adds object-oriented (OOP) features to it. However, it is very different from C++ in its implementation of those features (evidently it is closer to Smalltalk, although I'm unfamiliar with the latter). The biggest differences are that Objective-C is a relatively lightweight extension of C when compared to C++, and that Objective-C evaluates messages sent to receivers (approximately an analog to calling a method on a C++ object) at runtime, rather than making those connections at compile time. Objective-C is the preferred language to program Cocoa applications in if you want good performance and are not building a cross-platform app. If you go through Apple's documentation on Cocoa, you'll see that the primary language discussed is Objective-C. Also, you cannot access the Cocoa frameworks directly from either C or C++ ... you would have to use some sort of a wrapper (which would undoubtedly be written using Objective-C). I haven't done any timing, but I'd guess that for standard C constructs, the execution time of Obj-C code is essentially identical to C (and hence somewhat faster than C++). When using the Obj-C extensions, obviously it is going to be a bit slower than straight C code (just as C++ is), but you're getting the benefits of OOP in exchange. [/QUOTE]
Verification
Post reply
Forums
macOS & iOS Developer Playground
macOS - Development and Darwin
Best programming language for Mac
Top