• 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 and it's future
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Objective-C and it's future


  • Subject: Re: Objective-C and it's future
  • From: Rob Ross <email@hidden>
  • Date: Fri, 7 Jul 2006 17:29:39 -0700


On Jul 7, 2006, at 4:55 PM, Charlton Wilbur wrote:


On Jul 7, 2006, at 7:33 PM, Thomas Davie wrote:

The most basic extension of the type system I can think of is to allow something akin to generics, or ADTs to allow us to specify such things as what type of object an array contains.

Dynamic typing means you don't *need* Java-style generics or C++- style templates -- they are, after all, an attempt to give static typing the flexibility of dynamic typing. Java needs generics so that the compiler can determine what type an object is; Objective-C punts the decision to runtime. This is not a mistake, but an intentional design decision; the things that prevent you from doing stupid things often also prevent you from doing brilliant things.

I'm just learning Obj-C myself, so maybe my understanding is not correct. But, don't you actually have the option to use static typing in certain instances, and use dynamic typing in others?


Eg:

id	myStr;

vs

NSString *myStr;


Won't the second version give you the benefits of static typing (compiler time checking)?


So my understanding is you can have the best of both worlds. Or have I misunderstood something?

Rob Ross
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


  • Follow-Ups:
    • Re: Re: Objective-C and it's future
      • From: "Shawn Erickson" <email@hidden>
References: 
 >Objective-C and it's future (From: Thomas Davie <email@hidden>)
 >Re: Objective-C and it's future (From: Charlton Wilbur <email@hidden>)

  • Prev by Date: DVDPlayback
  • Next by Date: drag source help
  • Previous by thread: Re: Re: Objective-C and it's future
  • Next by thread: Re: Re: Objective-C and it's future
  • Index(es):
    • Date
    • Thread