4 ms·
This has nothing to do with static vs dynamic typing. In Java, for example, you can easily invoke a method named by a string that's not defined at compile time
by abstractbill 13y ago
This has nothing to do with static vs dynamic typing. In Java, for example, you can easily invoke a method named by a string that's not defined at compile time (using the reflection api).
- iso-8859-1 13y agoBut since you can't define methods using reflection, I'd say this isn't used much and isn't really a problem in Java. Are you really having trouble decyphering a Java function relying on home-made dynamic dispatch? But yeah, I'd say it's more about http://en.wikipedia.org/wiki/Dynamic_dispatch http://en.wikipedia.org/wiki/Dynamic_dispatch than static/dynamic typing. You can have dynamic dispatch in a statically typed language. I don't know how OP would feel about virtual methods in C++ since he resists using an IDE.
- mbell 13y ago> But since you can't define methods using reflection, I'd say this isn't used much and isn't really a problem in Java. You can do about anything you want with cglib / Javassist. Dynamically subtyping or byte code re-writing a class is how many Java ORMs work.
- ZitchDog 13y agoCorrect. You can also use Dynamic Proxies, for metaprogramming, which are built right into the language.
- Peaker 13y agoThat's a dynamically typed sub-language within Java.