by ReflectedImage · 2y ago · 0 comments
Static typing significantly increases code length compared to duck typing, significantly increases development times and significantly increases bug count per delivered software feature.
It additionally gives developers the false impression that you can write large projects in Python without splitting the codebase into small micro-services. Hint: You can't, it is always a complete disaster as Python's support for static typing isn't good enough for large projects.
Going to need a source for this.
You can easily find information on duck typed programs being significantly shorter and that statically typed and ducked typed programs have the same bug count per line. You can also look at the language defective tables showing ducked type Clojure as having the least bugs in commerical software and statically typed C++ having the most bugs in commerical software.
Google is your friend here.
If you're not going to bring bold numbers to support bold claims, why should any of us bother listening?
I mean you could always try to find some sources to try and prove me wrong if you want?
"Number of bugs will drastically increase" is simply wrong.
Type checking prevents bugs before they ship.
Type checking mostly shows that code can be compiled successfully. The thing it was designed to do.
I can say from that experience that pretty much everything you are claiming is wrong. Developers were enthusiastic about adopting type annotations. We found it made code easier to understand, gave better support from IDEs, made refactors easier, and caught bugs earlier.
Type-checking that codebase with Mypy was a technical challenge, but the Mypy team did a tremendous amount of work scale Mypy through caching and other optimizations. It was still slow, taking minutes at times, but way faster than the complete test suite.
Now, I will be the first to tell you not to write a 2Mloc server in Python, but if you happen to have created one, type annotations are huge boon to making it work.
I'm telling you the ducked typed micro-service based approach is the way to go.
But you sort of know that "not to write a 2Mloc server in Python", don't you? If we encourage developers to use static typing they will be writing 2Mloc monolithic servers. That's just the type of code that static typing encourages.
Encouraging static typing in Python is putting them down the path of disaster.
"If we encourage developers to use static typing they will be writing 2Mloc monolithic servers."
I don't even know where to begin with this wild assertion. Ill-advised as it was, Dropbox wrote its two million line server long before typed Python even existed. I wasn't around when they started cracking it up (see blog post below), but I strongly suspect the type annotations in the codebase helped rather than hindered that effort.
https://dropbox.tech/infrastructure/atlas--our-journey-from-...
The relevant term is Type Checker. Static Type Checker: Something that checks types statically (i.e. by inspecting the source code without running it). Doesn't necessarily say anything about compilation, execution strategy, or indeed if the user program will ever be run at all.
The majority of bugs in code are about the behavior of the code rather than the typing. You require unit tests or some other more advanced technique.
The error won't exactly point me to the source of bug and I was getting vague message that some data was missing .
And there were many instances of same throughout my project experience.
With typescript you will know instantly. The javascript being weakly typed compared to python necessitates use of typescript.
Sure, if one doesn't care about their code quality, after all everyone loves to write unit tests for every possible use case.
Static type checking has a measured bug catch rate of <1%. So the quality of any code where the programmer depends on static typing to verify correctness rather than unit tests is very very low.