3 ms·
IIUC, you're saying that failures are low stakes, so even if a good framework existed, the idea of using static types is flawed since is only slows you down com
by calderwoodra 3y ago
IIUC, you're saying that failures are low stakes, so even if a good framework existed, the idea of using static types is flawed since is only slows you down compared to dynamic types.
I disagree but my position is purely preference/subjective. The main point for me is that static types make reading other teammates code much easier. If I could use statically typed python/Django, that would be amazing.
- kingkongjaffa 3y agoYou probably already know but you can add type hints and then check for consistency with https://github.com/python/mypy https://github.com/python/mypy in python. Modern Python with things like https://learnpython.com/blog/python-match-case-statement/ https://learnpython.com/blog/python-match-case-statement/ + mypy + Ruff for linting https://github.com/astral-sh/ruff https://github.com/astral-sh/ruff can get pretty good results. I found typed dataclasses (https://docs.python.org/3/library/dataclasses.html https://docs.python.org/3/library/dataclasses.html) in python using mypy to give me really high confidence when building data representations. And there's https://pypi.org/project/django-stubs/ https://pypi.org/project/django-stubs/ for working with Django.
- catlover76 3y agoThings like MyPy and Pyre end up being a pain to setup, in part because of an annoying and unautomated "stub" ecosystem (it was like back in the day when you had to manually install or declare types for every JS package used in a TypeScript project). It really just doesn't feel as good or useful as using a statically typed language.
- ActorNightly 3y agoDynamic typing allows more dirty code, in the same way static typing allows for massive inheritance hell with factories and polymorphism. You can write clean Python without much fuss that is easy and simple to read.