3 ms·
Because development speed and flexibility matter way more than "correctness". Engineer salary is expensive, and there is software to manage running processes t
by ActorNightly 3y ago
Because development speed and flexibility matter way more than "correctness". Engineer salary is expensive, and there is software to manage running processes that makes errors in software in niche cases not a big deal because it can just restart the failed container or the failed process, publish logs, and then an engineer can implement a patch.
- calderwoodra 3y agoIIUC, 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.
- gavmor 3y ago"Correctness" isn't even the draw of static typing; speed and flexibility are. When I make a single business-relevant change, the compiler's error messages guide me to modify what must else accommodate. This is faster (and less error-prone) so I can get onto my next feature sooner.
- gls2ro 3y agoWhat kind of business-relevant change are you referring to here? I don't think the compiler with the error messages makes a difference when the business is pivoting between features, when they ask to add a new field to various forms, to generate new reports or add new emails in various points of the work flow. Or change the emails from one point to another point. Or add password less. Or just switch the external provider of an API from an important flow because there is a better deal elsewhere. I am not saying static typing does not provide speed or flexibility, but I just wanted to say that business-relevant change has more to do with features than code.
- gavmor 3y ago> business-relevant change has more to do with features than code I cannot comprehend this. It's like saying "Health has more to do with organs than cells." Organs comprise features. Features comprise code. To change the feature, one must change the code. If the code is not business-relevant, delete it. It's a liability. We are not artists. If the code is well-written, the compiler errors will echo the business' failings.
- ActorNightly 3y agoThats the "academic" advantage of static typing. In practice, it essentially leads to one of 2 things 1. Any time you have to make a change for a prototype, you have to go change a whole bunch of dependencies on your library, even if the change is not used in those explicitly, all because of the prototype. 2. You start introducing dependency hell or duplicate code, to either abstract stuff away so you don't have to do the prototype changes, or you start writing duplicate classes/functions to handle different parameters. Neither of which is either fast or flexible. Anyone who has worked at Amazon dealing with Java services can attest to this. Dynamic typing on the other hand is actually flexible and fast. For example in Python when building out something that is changing quite often, its very easy to pass around dict objects. And yes, dynamic typing, it can lead to more errors, but in practice, most all of these are caught during testing, and are just as straightforward to fix as compiler errors. If you try to access a dict field that is not in the passed dict, its pretty much equivalent to a compiler error.