4 ms·
That's kind of silly. If you're using Java and altering method signatures at runtime using reflection you're either in a very niche field where perhaps you shou
by SCdF 13y ago
That's kind of silly. If you're using Java and altering method signatures at runtime using reflection you're either in a very niche field where perhaps you shouldn't be using Java, or you're nuts.
Just because you can get around a feature doesn't invalidate that feature.
I'm not sure how I feel about static typing in Java, but it does do what OP talks about, because by default you're not playing devils advocate with reflection.
- alayne 13y agoThis problem happens with Spring all the time in Java which uses reflection. It's certainly not "silly" or a "niche field".
- Buttons840 13y agoI agree. With Java + Spring + XML you can get one language for the price of two! How useful is Java's type checking when one typo in an XML file breaks your program? At least in Python I can follow the logic of the language and find where the mistake is. Spring's XML files don't have such logic and usually all you have is a confusing traceback to work with.
- quacker 13y agoI'm not sure how I feel about static typing in Java, but it does do what OP talks about, because by default you're not playing devils advocate with reflection. Static typing can guarantee the functionality of quite a lot of code, but it cannot do this for any arbitrary piece of code. As an example, no compiler in any language can know what whether a user will numbers or garbage, when you're expecting numbers. You need to check for an exception in Java even in this simple case.