thanks for reading and commenting. I am incredibly bullish on static typing and static analysis in general. There are quite a few tools that bring these to PHP and JS (I am not entirely happy with PHPStan / Psalm, I am very pleased by Typescript). Before that, I have been using Jetbrains analysis tools.
In web development, I find that there is a certain freedom that comes with dynamic typing that I wouldn't tolerate in other systems software (my other specialization is embedded software), as easy templating and logging are givens.
The fact that so much in web can also be "caught" at runtime (monitoring, logging, tracing) changes the game quite a bit as well, giving dynamic typing a bit more breathing room.
I think it's the fact there are no compile times (those runtime tools you are talking about are at your fingertips) that people historically have not worried as much about types in PHP and JS. In many cases it does just feel like verbose boilerplate rather than a useful tool. Type checking is just one of the many things you can test by hitting ctrl+R, and you will be doing that anyways to test everything else. (Obviously, the bigger the project, the less that is true, but that argument is well-known). Personally, I spend exponentially more time correcting my typos than my types, and auto-completion of previous used variables and functions is worth a lot more than a type system to me in my day to day.
I will never argue against types, but unless I am working with somebody else, I don't need them.
In web development, I find that there is a certain freedom that comes with dynamic typing that I wouldn't tolerate in other systems software (my other specialization is embedded software), as easy templating and logging are givens.
The fact that so much in web can also be "caught" at runtime (monitoring, logging, tracing) changes the game quite a bit as well, giving dynamic typing a bit more breathing room.