• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Dynamic Languages [was: Re: why Obj-C]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Dynamic Languages [was: Re: why Obj-C]


  • Subject: Re: Dynamic Languages [was: Re: why Obj-C]
  • From: Dan Crevier <email@hidden>
  • Date: Fri, 05 Apr 2002 21:44:21 -0800

On 4/5/2002 6:26 PM, "Matthew Johnson" <email@hidden> wrote:

>> * It solves the fragile base class problem. If you try to ship a C++ shared
>> library that others can use, as soon as you update it, all apps need to be
>> relinked since everything is pointer driven. With the message dispatching
>> in Objective-C, no such problem exists.
>
> That's not true. I think your are mistaking static libraries with dynamic
> libraries. A good example of shared objects doing what you say they cannot
> is plugins for programs like netscape or explorer.

Netscape/Explorer plugins use a C API, not a C++ API. If you use C++ in a
dynamic library, any application linking to it will break if you change the
class's API.

>> * It makes a lot of the functionality in IB possible. For example, you can
>> specify in IB to call a function basically by name when a button is clicked
>> or whatever. Of course, you get a runtime error instead of a compile time
>> error if you screw up. To do the same thing in with a C++ framework
>> requires having the interface builder generate code instead of just
>> resources, and that because a big mess when you also want to edit that code
>> and then go back and make UI changes.
>
> Again this can be be done using shared objects in C.

What are shared objects? Do you mean or C++? C doesn't have objects.

>> * Some idioms like delegates rely on being able to query an object to see
>> what it can refer to. C++ soltuions, like PowerPlant's Lattachment aren't as
>> elegant.
>
> I am not familiar with PowerPlant but you can get the available list of
> methods/functions/globals from shared objects.

Again, what's a shared object?

> I think the advantage is that the code is written for you to do this and it
> happens seamlessly. Where with C you would have to write all the code
> yourself. Doing this is really forcing a methodology. I am not sure how I
> feel about this and need to give it more thought.

Exactly. In C/C++, you could have objects that knew how to take an action
based on a string to give yourself a dynamic environment. Objective-C makes
this easy, and has a powerful framework based on it.

> But again this is really the essence of C. Its power lies in its simplistic
> low level small language. C does very little for you but it lets you do
> anything. Because of its size it compiles to very efficient object code.

And C++ is very efficient too. The dynamic nature of Objective C definitely
comes with a performance price.

Dan
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.

  • Follow-Ups:
    • Re: Dynamic Languages [was: Re: why Obj-C]
      • From: Matthew Johnson <email@hidden>
References: 
 >Re: Dynamic Languages [was: Re: why Obj-C] (From: Matthew Johnson <email@hidden>)

  • Prev by Date: Re: Dynamic Languages [was: Re: why Obj-C]
  • Next by Date: Re: Dynamic Languages [was: Re: why Obj-C]
  • Previous by thread: Re: Dynamic Languages [was: Re: why Obj-C]
  • Next by thread: Re: Dynamic Languages [was: Re: why Obj-C]
  • Index(es):
    • Date
    • Thread