My rationale given on another comment is when writing web apps, everything comes in as text so you have to parse/convert and validate parameters anyhow.
Dynamic makes a lot of sense for web programming. Static should definitely be used in high risk software where its life and death, medical devices, rockets, nuclear plants, etc.
Speaking for myself I'm static or death, BUT I can see how one might come away scarred from C++ and conflate static with the wild degree of ceremony and clunky tooling.
Nowadays the better static languages do a lot of type infererence so that a lot of that ceremony is pushed aside.
I recently did some semi-serious python work and I see some of the appeal; I definitely missed mandatory type declarations at the function argument level but barely if at all within functions.
There's a great Steve Yegge post about this topic of static/dynamic alliegence (via someone's gist because Google can't run a service long term for love or money): https://gist.github.com/cornchz/3313150
I started my coding career in C++. I know static well enough for my lifetime. It makes sense that if you're in the 1980s and choose static as the designer of the language.
But now the choice is available, why would you want to declare the variable. In my code I want to write "bob =" and the language figures that all out. If I feed a string into it or a number, why does it matter?
It saves me oodles of time not having to be concerned at all about that.
It's also very interesting in functions. Yes, I have been using the typing in python. def process_bob(self, bob: int) -> bool:
Technically i can shove whatever i want into that arg of bob. Imagine the function was a network protocol. v 1.1 did X, v1.2 did X and Y. That int becomes perhaps a list and that's totally fine. Very reusable, because iterating, process_bob can just become if bob == int: elif bob == list.
Why would I want my programming language to make things harder on myself for literally no gain?
My rationale given on another comment is when writing web apps, everything comes in as text so you have to parse/convert and validate parameters anyhow.
Dynamic makes a lot of sense for web programming. Static should definitely be used in high risk software where its life and death, medical devices, rockets, nuclear plants, etc.
Speaking for myself I'm static or death, BUT I can see how one might come away scarred from C++ and conflate static with the wild degree of ceremony and clunky tooling.
Nowadays the better static languages do a lot of type infererence so that a lot of that ceremony is pushed aside.
I recently did some semi-serious python work and I see some of the appeal; I definitely missed mandatory type declarations at the function argument level but barely if at all within functions.
There's a great Steve Yegge post about this topic of static/dynamic alliegence (via someone's gist because Google can't run a service long term for love or money): https://gist.github.com/cornchz/3313150
>Why dynamic over static?
I started my coding career in C++. I know static well enough for my lifetime. It makes sense that if you're in the 1980s and choose static as the designer of the language.
But now the choice is available, why would you want to declare the variable. In my code I want to write "bob =" and the language figures that all out. If I feed a string into it or a number, why does it matter?
It saves me oodles of time not having to be concerned at all about that.
It's also very interesting in functions. Yes, I have been using the typing in python. def process_bob(self, bob: int) -> bool:
Technically i can shove whatever i want into that arg of bob. Imagine the function was a network protocol. v 1.1 did X, v1.2 did X and Y. That int becomes perhaps a list and that's totally fine. Very reusable, because iterating, process_bob can just become if bob == int: elif bob == list.
Why would I want my programming language to make things harder on myself for literally no gain?