by orf · 7y ago · 0 comments
Among hundreds of other things, getting the return type of a method and getting the input parameter names (+ types) in a way that doesn't revolve around literally parsing the functions toString() representation.
Oh, and typeof checking that isn't disgustingly broken.
Type information literally doesn't exist at runtime, though. Isn't it kind of ridiculous to compare languages like that?
To draw out that analogy... we live in Greenland. Cars with skis are surprisingly useful.
Correct if I'm wrong, not all types get erased in Java. Doesn't type erasure only happen for generics? Say I have a non generic, plain Java class and want to inspect one of it's method's return types at runtime to see if it returns class A or class B. I can do that, right?
Ah, that's quite cool.
Which in some ways is a good thing as you can do a lot more optimizations.