Ask HN: How do you work with dynamic type programming language
How do you make the codebase written in dynamic type programming language maintainable over time?
By written a lot of tests that are more strict than the type system?
I know statically type-safe along is not enough because it doesn't prevent logical error but isn't having it better than not?
5 comments
[ 0.25 ms ] story [ 59.5 ms ] threadI really don't see much appeal in dynamic typing beyond simple scripts and solving Leetcode style problems.
My current default language is unfortunately still Python lol, but I want to make that Haskell or OCaml soon if possible (and if I have time to devote to learning them!)
I hear that OCaml, at least, is fairly adaptable to multiple use-cases.
Likewise, most any static typing language out there allows you to ride shitty code should you so chose. In fact, it seems to be that the more strict a language is, the more people try to get around the strictness for their particular use case, and consequently, you get a bunch of standardized syntax or libraries for this that create more complexity than is needed.
The only real value of having static typing is having ULTRA strict real static typing where you define what data is, what operations can you do on that data, and what are all the possible outcomes on that data. Then, if you program compiles, by definition, it is correct. I think Coq comes pretty close to this, considering its designed as a theorem prover.