4 ms·
Extrapolating, the same rant applies to all duck-typed languages: the number of possible outcomes for a=b+c explodes depending on types and contents of a,b and
by old-gregg 17y ago
Extrapolating, the same rant applies to all duck-typed languages: the number of possible outcomes for a=b+c explodes depending on types and contents of a,b and c, therefore his first assumption about one dimensional space is incorrect.
This is why most C++ teams prohibit their members to overload operators.
- hetman 17y agoPrecisely. This sounds like an argument for the superiority of static typing more than anything.
- zaphar 17y agoOnly if your static types for strings include a seperate type per encoding. Most languages including the ducktyped just use a single encoding internally "utf-8" for example. So the String type is always compatible. For Ruby though it sounds like the string type could be any encoding. That to me sounds dangerous. It's not caused by the language being ducktyped. It's caused by the language having the same type with multiple behaviours. Ruby made strings into a mine field for 99% of programmers and safer for 10% Not sure that's a good ratio.