This link has been bookmarked by 4 people . It was first bookmarked on 23 Aug 2007, by Navneet Kumar.
-
23 Aug 07
-
"Java Generics" are actually not generics at all, but simply an autocasting mechanism
-
Java Generics" are actually not generics at all, but simply an autocasting mechanism
-
"directing" approach (you want to provide guidance to prevent people from falling down) or an "enabling" approach (you want to provide tools and abilities that allow people to move forward faster)
-
the type is still there, it's just implied. So on a very simple level, you could look at it as a device that writes interfaces for you, so that you don't have to. It's an enabling device that reduces the amount of code you have to write.
-
Why do we want to use latent typing? It's a code organization and reuse mechanism.
-
But look at what the
interfacedoes: it weakens the type constraints by first decoupling the interface from implementation – so you only have an outline of what the type looks like, but no semantics attached. -
So with interfaces, you're able to say "I don't care what type you are as long as you can perform these operations."
-
So the constraint-loosening mechanism is already there, in the form of interfaces. Latent typing simply takes this one step further, and makes that interface latent so you don't have to express the interface, or to implement it in every class that you want to use in the function. Since we already have interfaces, latent typing is just a coding convenience.
-
it's not possible to prevent people from doing something bad with your programming system no matter how safe you attempt to make it. And there's a boundary beyond which all the "directing" guidance will fail -- a programmer must have a certain level of understanding and be able to buy into a particular language, environment, framework, etc., up to a certain level in order to use those tools properly. Less than that, and they need training, not type-checking.
-
Latent typing simply makes the interfaces implicit by, in effect, writing both the
interfacepart and theimplementationpart for you.
-
-
09 Mar 06
Would you like to comment?
Join Diigo for a free account, or sign in if you are already a member.