4 ms·
I've worked with both Java and Python extensively. Python's type system is far more exhausting, tbh. You have to think about types in both languages, but at lea
by HauntingPin 7mo ago
I've worked with both Java and Python extensively. Python's type system is far more exhausting, tbh. You have to think about types in both languages, but at least in Java, the compiler and static analysis can tell you if there are type-related issues. In Python, runtime errors. Anything larger in Python becomes a nightmare to work with because you basically never know for sure what's being passed into a function without excessive type checking and testing.
- ashishb 7mo agoAnd you can never mandate that optional type checking in a big enough team. You can even see popular FOSS Python packages that have very limited type checking.
- maleldil 7mo agoWhy not? Have mypy/pyright/pryefly/ty type errors break CI. If you're starting a new project, there's no reason you shouldn't.
- ashishb 7mo ago> Have mypy/pyright/pryefly/ty type errors break CI. Only if types are present. > If you're starting a new project, there's no reason you shouldn't. Most dependencies would still be untyped.
- maleldil 7mo ago> Only if types are present. Make sure they are. Set no implicit any in your type checker, and use a linter to ensure every function has type annotations. > Most dependencies would still be untyped Most is a big exaggeration. I understand it's dependent on the domain, but only a small subset of the ones I use in my projects are untyped, and you can write typed wrappers when necessary. Also, perfect is the enemy of the good. I'd rather have a 90% typed codebase and work around untyped dependencies than abandon the idea at all.