3 ms·
Oh, I see, given the interpreter is written in strongly typed language, allowing to go without static typing is a feature by itself, and allowing to test for me
by oelmekki 8y ago
Oh, I see, given the interpreter is written in strongly typed language, allowing to go without static typing is a feature by itself, and allowing to test for methods presence allows to do duck typing, thus it allows to say that ruby implements duck typing.
It makes more sense than talking of duck typing explicit usage by end users, given it's quite rare we assert proper received parameters extensively.
EDIT : which makes me realize we have a machine language without typing (binary), on top of which we use a language implementing strong typing (C), used to build a language without strong typing (ruby), on top of which Stripe is building strong typing. Making a definitive decision is hard :)
- mdpye 8y agoNitpick: C is weakly typed, Ruby is strong. C is statically typed, Ruby is dynamic. Strong typing is about objects having a definite type. In Ruby, you cannot cast a String to a Fixnum, an exception will be raised. But in C you may cast anything to anything really, and your program will believe you, whether it could possibly make sense or not...
- oelmekki 8y agoI thought "strong typing" and "static typing" were interchangeable. I stand corrected, thanks.