D versus Objective C Comparison

Chris R Miller lordsauronthegreat at gmail.com
Sun Feb 1 17:52:11 PST 2009


John Reimer wrote:
> Hello Chris,
> 
> 
>> http://www.fsdev.net/~cmiller/a/20090123_dvobjc.html
>>
>> Also, I do honor the right of reply.  If there's something I have
>> written that is now incorrect or inaccurate I will of course change my
>> page to reflect that.  Heck, all the comparisons in the world are
>> worthless if they aren't accurate!
>>
>> Have a great day, and keep up the good work!  I personally can't wait
>> until D gets to the point that a (total bonehead) like me can install
>> it on OS X!  Alas, right now it seemeth to require more brain cells
>> than I have at my disposal.
>>
> 
> 
> Here's a couple comments:
> 
> 
> (1) I'm surprised that, in your Objective C introduction, you don't 
> indicate that the langauge is a direct decendant of Smalltalk.  
> Interestingly you mention Smalltalk in the D introduction instead, even 
> though the only similarity between the two is that they both implement a 
> form of OO programming.  Objective C is practically C with embedded 
> Smalltalk. A major purpose for the creation of Objective C was to bring 
> the benefits and explicit OO style of SmallTalk to C language developers.

To me it seems that every language borrows from SmallTalk.  So I prefer 
to just ignore it as the father or all modern language design patterns.

I link to stuff so that people can do more reading if they want. :)

And again, I'm not there to really give a history lesson, more to 
analyze the situation of "you want to build an app which does foo, which 
is better for that purpose?"  (the answer is that it depends: who do you 
want to support?  Windows and Linux, or OS X?)

> (2)  The DWT port doesn't support 64-bit platforms (so far as I know), 
> so I don't understand why this is called a bug.  The two ports of SWT 
> that are currently supported are dwt-win and dwt-linux, both 32-bit 
> versions and dependent on a 32-compiler (dmd for x86).  dwt-mac is still 
> in development by Jacob Carlborg: this version is compiled with gdc for 
> Mac and is also 32-bit, so far as I know.

Yes, the 32-bit-ness of DWT has distressed me for some time.  When I had 
DMD working on Ubuntu a while back I tried to make DWT work... the code 
is 64-bit compatible AFACT, but it needs some work with the libraries it 
links to - they're not 64-bit compatible.  I wasn't up to re-writing the 
library linkage (or the prospect of maybe finding that the code itself 
isn't 64-bit compatible!) so I just left it unfixed in hopes that 
someone else would fix it someday.

> Finally, I agree most with what you say here:
> 
> 
> "I stand by my original statement that they're different languages and 
> different tools for different purposes."
> 
> 
> My take on it is this:
> 
> 
> Some of Objective C's features are very useful (dynamic OO extensions 
> and runtime binding); however, I think that Objective-C is really meant 
> to be a sort of domain specific solution for which the Cocoa development 
> experience is optimized: the language is purposely simple, which makes 
> it significantly useful for its intended task.  I know Apple recently 
> updated the language to Objective C 2.0 that added a few more 
> convenience features, but I don't think they even argue that it's 
> directly competitive with C++ (however, I cannot verify this).  In fact, 
> for those that might need to use other libraries or use more powerful 
> features only available in C++, there's the option of developing in 
> Objective C++.
> 
> 
> Finally, I don't think Objective-C was intended to be a general-purpose 
> programming language in the manner of D or C++, so the comparison will 

I would argue the opposite.  Objective-C retains the ability to compile 
and run *any* code that C can.  C is a general-purpose language. 
Therefore Objective-C is a SmallTalk-ish extension of a general-purpose 
language.

To me, it's the lack of really strong multiplatform support that keeps 
Objective-C from being more of a multiplatform general-purpose language, 
but it's still a general-purpose language to me.



More information about the Digitalmars-d mailing list