3 ms·
Can you expand on "mypy is a much better type system than Java"? I'd love it if that were true.
by iak8god 9y ago
Can you expand on "mypy is a much better type system than Java"? I'd love it if that were true.
- baq 9y agoIt has e.g. a proper Union type, generics and type inference. Lack of pattern matching hurts, but then, Java doesn't have that either. You can also configure how strict you want the checks to be. There are downsides though: type stubs are of... varying... quality, there are ugly hacks needed to resolve cyclic imports and the type annotation syntax gets yucky in places, even in 3.6. I'm using mypy seriously for about a year and it's progressing very well. I see very good ROI even with the uglification of the code.
- iak8god 9y agoI'll check it out. Thanks!
- nayuki 9y agomypy can help you ensure that a variable is never None, whereas it's still tedious to manually check for null in Java.
- coldtea 9y agoSeems trivial, if Python which is so dynamic could get it, to give it to Java with a similar static checker. Haven't checked, but I find it absolutely possible that there's one (or more).