Have you written code in an ML flavored statically typed language? If not then I highly recommend experiencing it. Your post (especially that second reasoning) reminds me of my pre-ML days when I used to be rabidly anti-static typing.
In theory what you say is equivalent, but in practice, thinking about these things at the design phase is far more easier than to handle them with testing (which is pretty forgiving if you miss things).
I'm not rabidly anti-static typing. If anything, I -prefer- it. I use Dialyzer and type specs when writing production Erlang code. I actually -wish- Erlang had better static typing options.
But I recognize that as -personal preference- when it comes to Erlang. It allows me (and my teammates) to be explicit, and the machine helps me (us) be consistent in my explicitness, even when, again, via experience, I know it doesn't really effect how reliable the code is. Reliability in Erlang comes from testing, and proper supervisor patterns and reasoning. Static typing might reduce the number of supervisor restarts, but it doesn't reduce my test surface, nor the need to ensure arbitrary restarts get my system back to a good state. Even when using Dialyzer, it didn't push the needle on how reliable the system was. It just changed the characteristics of writing/reading the code; a bit more work to write, a bit less work to read.
I am totally with you. I was just saying that for me personally some static type checking would really help, not particularly with Erlang but with other duck typing languages.
In theory what you say is equivalent, but in practice, thinking about these things at the design phase is far more easier than to handle them with testing (which is pretty forgiving if you miss things).
https://i.redd.it/2uxj8u6yx9121.png