Re: A question about static typing
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?