isn't much better.
Java might not be perfect, but it does let you catch a lot of problems at compile time rather than run time, which is a step in the right direction. The alternative (run it and see) gets old fast.
isn't much better.
Java might not be perfect, but it does let you catch a lot of problems at compile time rather than run time, which is a step in the right direction. The alternative (run it and see) gets old fast.
Yes, there is a value in static typing, but that value is minimized when you have a type system that isn't particularly expressive and/or have to make add a lot of redundant code to satisfy a comparatively unsophisticated type checker.
Java may have gotten slightly better since its poor performance in cost:benefit terms when it came to static typing helped launch the surge in popularity of dynamic languages, but its still not a great poster child for the benefits of static typing.
Also what are you doing that you need type information at runtime?
And as type erasure happens very, very early in the compilation process, you lose a lot of static type information the compiler could act on or give you warnings.
Don't let Java's type declarations fool you into thinking that Java is statically typed. It's still dynamic typing, with merely some kind of type hints slapped on top to be checked at compile time.