Dynamic typing made sense back when static type system weren't as good as they were now.
One can argue that modern statically typed language still have a lot of dynamic typing where the type system is not expressive enough, as in say in Rust indexing out of bounds is a dynamic error. In Idris, the type system is strong enough to enforce it.
Dynamic typing was very attractive in the days of Common Lisp and C when static parametric polymorphization didn't exist yet.
What even is "weak typing"? I don't get it. Either there is typing or there isn't. What can be weak or strong about it?
It's a very subjective term but it basically means “implicit type conversions”.
Some languages allow adding a number to a string and convert one of them then. C also allows adding integers to floats and automatically converts the integer in that case to a float. OCaml doesn't allow it, it even has a difference between a ”+" and a "+." operator, the latter for floats, on the reasoning that integer and float addition are two fundamentally different operations.
>What can be weak or strong about it?
It's a misnomer. It ought to refer to whether types attach to values or to variables. The idea of values being the typed entities seems to break some people's brains.
That's dynamic vs static typing, and also not really that.
In languages without mutable variables, like Haskell, it's the same thing, but it's statically typed, or so they say because as said, indexing is dynamically typed and whether the index is out of bounds is only resolved dynamically.
i just bought a mechanical keyboard and if i so much as blow on a key it presses. if i look at a key for too long it presses. i really need a strongly typed keyboard again what a waste of money
>What can be weak or strong about it?
It's a misnomer. It ought to refer to whether types attach to values or to variables. The idea of values being the typed entities seems to break some people's brains.
this. if your js project doesn't feel like it's duck taped together & built random objects you found around the house it's not real js.
banging out a quick utility script or prototype fast & loose. this is the sovl of js and weak typing.
I get that and I get the argument for dynamic types for the sake of easy scripting (like in python), but there is 0 reason for weak types
"its fine" is not an argument
I don't get it, either. If you assign a descriptive name to a variable, which you more than likely will, then the name of the variable will imply the type of the value it is bound to. It's not like you would ever name a variable as "loop_counter' and then assign an (x,y) coordinate to it. So why not just annotate the type of the variable while you're naming it?
Reminder: only strong and static typing matters. Dynamic and strong is gay, dynamic and weak is gay and moronic.
morons
Dynamic typing made sense back when static type system weren't as good as they were now.
One can argue that modern statically typed language still have a lot of dynamic typing where the type system is not expressive enough, as in say in Rust indexing out of bounds is a dynamic error. In Idris, the type system is strong enough to enforce it.
Dynamic typing was very attractive in the days of Common Lisp and C when static parametric polymorphization didn't exist yet.
It's a very subjective term but it basically means “implicit type conversions”.
Some languages allow adding a number to a string and convert one of them then. C also allows adding integers to floats and automatically converts the integer in that case to a float. OCaml doesn't allow it, it even has a difference between a ”+" and a "+." operator, the latter for floats, on the reasoning that integer and float addition are two fundamentally different operations.
That's dynamic vs static typing, and also not really that.
In languages without mutable variables, like Haskell, it's the same thing, but it's statically typed, or so they say because as said, indexing is dynamically typed and whether the index is out of bounds is only resolved dynamically.
i just bought a mechanical keyboard and if i so much as blow on a key it presses. if i look at a key for too long it presses. i really need a strongly typed keyboard again what a waste of money
should have gotten a mechanic keyboard
What even is "weak typing"? I don't get it. Either there is typing or there isn't. What can be weak or strong about it?
>What can be weak or strong about it?
It's a misnomer. It ought to refer to whether types attach to values or to variables. The idea of values being the typed entities seems to break some people's brains.
Dependent types would be a kind of "weak" typing then, no?
>He prefers DYEL typing
javascript was meant to be 500 lines max. for simple js it just WORKS.
this. if your js project doesn't feel like it's duck taped together & built random objects you found around the house it's not real js.
banging out a quick utility script or prototype fast & loose. this is the sovl of js and weak typing.
I get that and I get the argument for dynamic types for the sake of easy scripting (like in python), but there is 0 reason for weak types
"its fine" is not an argument
its fine though
if you're talking about all the weird implicit conversions in js isn't solely for the reason of backwards compatibility at this point?
Would you want types in a bash script?
there are no types in assembly nocoder
Captcha:kkk
how is that even remotely relevant
More like 50 lines max, and there is no situation where it "just works" where it would not "just work" with strong typing. Literally none.
oh yes just let me define my UserGenericDateContainerObject and my ModifiedDivWidthObject for my 50 lines of code
Your CPU instruction set is weakly typed.
no it's not i'm running on an iAPX 432
I don't get it, either. If you assign a descriptive name to a variable, which you more than likely will, then the name of the variable will imply the type of the value it is bound to. It's not like you would ever name a variable as "loop_counter' and then assign an (x,y) coordinate to it. So why not just annotate the type of the variable while you're naming it?
Who even does this.
Most people just all their loop counters “i” or “n".
Ken