Re: What is the purpose of static typing?
Re: What is the purpose of static typing?
- Subject: Re: What is the purpose of static typing?
- From: Ondra Cada <email@hidden>
- Date: Thu, 25 Jul 2002 02:36:17 +0200
On Thursday, July 25, 2002, at 02:00 , 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'?
The dynamism stays unchanged, and static typing helps you to find typos
and simple errors before you even started debugging.
That said, static types are indeed almost superfluous from the
functionality point of view. The only situation when they can't be
replaced by ids without any problems are -- slightly incorrect, but
possible -- messages with same name, but different signatures, like
@interface Foo
-(int)blah;
@end
@interface Bar
-(double)blah;
@end
Now, [(Foo*)x blah] and [(Bar*)x blah] are compiled differently.
---
Ondra Cada
OCSoftware: email@hidden
http://www.ocs.cz
private email@hidden
http://www.ocs.cz/oc
_______________________________________________
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.