• 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: Objective C language question: Making init like a contrustor
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Objective C language question: Making init like a contrustor


  • Subject: Re: Objective C language question: Making init like a contrustor
  • From: Jeff LaMarche <email@hidden>
  • Date: Sat, 25 May 2002 22:10:37 -0700

On Saturday, May 25, 2002, at 02:53 PM, Michael Gersten wrote:

> The basic question: Is it possible to design a runtime so that init's can
> act like constructors?

My first thought as I read your question is, "Why?" I have lost touch with
C++ and the myriad directions it has sprawled into, but I simply don't see
why you would ever have any reason to implement this type of behavior. Objective-C
is weakly typed and late bound, so I don't understand what you would achieve
by doing this. The runtime engine just doesn't care what ISA is, it only cares
if the object responds to a message or not, and even if it doesn't, it doesn'
t really hurt much if you send it that message.

C++ is a confining and restrictive language, which is why it has incorporated
every good idea (or seemingly good idea) that has come along. While I do think
there are a few areas where Objective-C could use some tweaking (e.g. something
like Java packages so that we didn't all need to funk up our class names with
preliminary initials), but overall it's a fine example of simpler is better.
C++ has many things Objective-C does, but very few that Objective-C needs.
Trying to compare C++'s RTTI to Objective-C's introspection is almost ridiculous.

So, I'm sure there is a way to implement what you suggest without changing
the runtime engine, but I can't imagine that anyone would.

But please feel free to elucidate if you think there is a compelling reason
for adding this...

- Jeff
_______________________________________________
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: Objective C language question: Making init like a contrustor
      • From: Ondra Cada <email@hidden>
References: 
 >Objective C language question: Making init like a contrustor (From: Michael Gersten <email@hidden>)

  • Prev by Date: Objective C language question: Making init like a contrustor
  • Next by Date: NSTextView multiple selection colors
  • Previous by thread: Objective C language question: Making init like a contrustor
  • Next by thread: Re: Objective C language question: Making init like a contrustor
  • Index(es):
    • Date
    • Thread