Comment by ReflectedImage
2 months ago
Absolutely not. Duck type based development results in working code out of the door 3x faster than static type based development. It always has since ancient times.
If performance wasn't an issue, then the static type based developers would all be fired. Either directly or by the businesses who relied on them getting driven into bankruptcy by their competitors. You would still get some niche jobs in it where they like to do formal verification of the code.
Your problem is just that your development skills from static type based development don't transfer to duck type based development. Different style of codebases needs to be handed completely differently.
I am talking about gradual typing here. Types are optional, if not given or implied they default to any. No need to annotate anything. If given they are enforced, and lead to optimized op codes and errors if violated. Some at compile-time, some at run-time. If fully typed, all errors are caught at compile-time already.
Duck typing as done with python is the worst of both worlds. No optimizations, no enforcement. Just optional external typechecks.
Of course untyped code (ie runtime types in each var) is to write faster. You only need to add types to some vars or args, and gradually improve from there. Eg ints only, because they are optimized the easiest. No need to check for strings, bigint, floats,.... Or arrays to check for overflows at compile-time and restrict to ints or strings. Massive improvements possible, in size and runtime.
Or object fields. Hash lookups vs static offsets.
If JITs hadn't been invented you would be completely right but JITs have been invented.
There are deeper optimizations that JITs can do such as knowing at runtime that the value of a variable is always 2 that typing information simply can't express.
Duck typed Python is optimal for development speeds, the only thing that matters in startup environments. It has it's niche.
You aren't gradually improving, you are gradually deteriorating the codebase to make it look more familar to you.