HACKER Q&A
📣 aabbcc1241

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?


  👤 catlover76 Accepted Answer ✓
I am not even close to being among the better software developers on here, so my opinion may not count for much, but I agree, having static typing is simply better than not, full stop.

I 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.


👤 satvikpendem
It's simple, I don't work with dynamically typed languages. But if I had to, for work or some other purpose, I'd try to leverage as much type hinting ad possible, such as with Python and Ruby which both have type hinting systems. Barring that, yes, I'd write lots of tests.

👤 muzani
Ironically, dynamic works better for situations where you don't want to be using tests. i.e. prototypes/proof of concept. For long term scenarios, or if you're writing tests from the start, static might be best. If you have a hacky culture, static would be even more vital.