• 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: What is the purpose of static typing?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: What is the purpose of static typing?


  • Subject: Re: What is the purpose of static typing?
  • From: Nicholas Riley <email@hidden>
  • Date: Wed, 24 Jul 2002 19:18:19 -0500
  • Mail-followup-to: email@hidden, email@hidden

On Wed, Jul 24, 2002 at 08:00:49PM -0400, email@hidden wrote:
> Is there any purpose in static typing besides better compile time
> checking? In other words, would it not be better (for dynamism) to
> simply declare everything as `id'?

Of course, but you're likely to create many more bugs that way. Even
Smalltalk IDEs do compile-time checking to see if the methods you're
invoking are defined somewhere in the image, to avoid typos etc. And
you'll need some other convention to indicate the expected type of
methods and instance variables. Personally I like being able to name
my methods and variables whatever I want, so they don't necessarily
have to incorporate type information as a matter of convention the way
they do in Smalltalk.

Use id when you need it, otherwise statically type.

--
=Nicholas Riley <email@hidden> | <http://www.uiuc.edu/ph/www/njriley>
Pablo Research Group, Department of Computer Science and
Medical Scholars Program, University of Illinois at Urbana-Champaign
_______________________________________________
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: What is the purpose of static typing?
      • From: Philip George <email@hidden>
References: 
 >What is the purpose of static typing? (From: email@hidden)

  • Prev by Date: Re: NSTask problems.
  • Next by Date: Re: NSTask problems.
  • Previous by thread: What is the purpose of static typing?
  • Next by thread: Re: What is the purpose of static typing?
  • Index(es):
    • Date
    • Thread