• 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: A question about static typing
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: A question about static typing


  • Subject: Re: A question about static typing
  • From: Chris Gehlker <email@hidden>
  • Date: Sun, 22 Jul 2001 08:40:41 -0700

On 7/21/01 10:30 AM, "Greg Titus" <email@hidden> wrote:

> But to get back to the main point: yes, using static typing whenever you
> know what kind of object you are expecting is good practice because then
> you do get those compiler warnings that _usually_ mean you've done
> something wrong.

Thanks Tony & Greg,

I think it's just a flaw in the book that they don't follow their own advice
and static type whenever possible. I've been reviewing it and come across
examples like refreshCalendar that starts out:

NSCalendarDate *firstOfMonth *selDate
...
id cell

That made me ask "Why not 'NSButtonCell *cell'?"

But then looking at other functions, it is "NSButtonCell *aCell" so I guess
they just missed a few. One place they seem consistent, though, is in using
id for the return type of initializers. Is this a convention?


  • Follow-Ups:
    • Re: A question about static typing
      • From: "Dennis C. De Mars" <email@hidden>
References: 
 >Re: A question about static typing (From: Greg Titus <email@hidden>)

  • Prev by Date: Re: Using beginSheet
  • Next by Date: Re: Stopping a tool after launching with AuthorizationExecuteWithPrivileges
  • Previous by thread: Re: A question about static typing
  • Next by thread: Re: A question about static typing
  • Index(es):
    • Date
    • Thread