| |||
| [Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] |
| I think you may be throwing the baby out with the bath water. I can understand the appeal of running programs to test them – it makes you feel like you have done something. Getting a type error "seems" to get in the way of your program running. However, maybe you should consider a type checker (built into a compiler) as a kind of execution mechanism, that pretests your program before it is actually run on the target machine. The other thing that type systems might have against them is that you can end up writing the same algorithm for different types, leading to repetitive code. This is where type systems can lack the sort of flexibility you are seeking. However, this need not be a problem with type systems. (It's too long to write up why in a short email.) You also need implementation flexibility. For instance, you may realize that a stack is not as good as a list for your implementation. Unfortunately, most libraries name the operations in their APIs differently, so you would have to change all your calls to stack push and pop to list add and remove. This also need not be the case (and is why Eiffel libraries actually go to a lot of trouble to have consistent and simple naming conventions, even if this seems strange to most who have been brought up to expect push and pop terminology for stacks). I think this is a most interesting area of research, reconciling typing with flexibility of non-typed systems, and I believe it can be done. (Objective-C does it in part by having id, but then types as well). I don't understand your Map example, method1 to me looks perfectly like it expects Map at compile time. (Maybe my not understanding it is too many negative in "There's nothing here that's going to tell you at compile time if your message is valid unless it's not a Map".) As for stack dumps, I have been reading them for 30 years. As you say, they show you where your program broke, but with Java (very unsatisfyingly), that's all they tell you – where are the locals and other system state information that tells you why the program broke? I can't say the style of programming terrifies me, but it does interest me, but I don't really think abandoning types is an altogether wise choice (catching errors statically can be far more efficient that having to repeatedly test for them dynamically – sounds like a lot of work for us lazy people), but I have an open mind. Ian On 21/07/2007, at 7:17 AM, Paul Cunningham wrote:
|
_______________________________________________ Do not post admin requests to the list. They will be ignored. Java-dev mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/java-dev/email@hidden This email sent to email@hidden
| References: | |
| >Re: UML IS REALLY IMPORTANT .... or not? (From: Paul Cunningham <email@hidden>) |
| Home | Archives | FAQ | Terms/Conditions | Contact | RSS | Lists | About |
Visit the Apple Store online or at retail locations.
1-800-MY-APPLE
Contact Apple | Terms of Use | Privacy Policy
Copyright © 2007 Apple Inc. All rights reserved.