3 ms·
Languages may not be perfect, but language features can be compared, and some features are strictly more powerful than others. There is scope for legitimate cr
by dons 12y ago
Languages may not be perfect, but language features can be compared, and some features are strictly more powerful than others.
There is scope for legitimate criticism of language design based on the expressive power^1 of their features.
In this case, generics would make Go strictly more expressive, as, without it you must write O(n) more code or perform a global refactoring to simulate it.
1. http://citeseerx.ist.psu.edu/viewdoc/summary?doi=10.1.1.51.4656 http://citeseerx.ist.psu.edu/viewdoc/summary?doi=10.1.1.51.4...
- skybrian 12y agoYou can compare language features this way, but it won't tell you which language is a better fit for a particular problem. JSON is strictly less powerful than JavaScript and it's easy to come up with examples of data that can be better compressed in JavaScript. But for what we use JSON for, not being Turing complete is a feature. When programming in an intentionally restricted language, the question is whether the limitation in power is put to good use in some other way.
- skybrian 12y agoYou can compare language features this way, but it won't tell you which language is a better fit for a particular problem. JSON is strictly less powerful than JavaScript and it's easy to come up with examples of data that can be better compressed in JavaScript. But for what we use JSON for, not being Turing complete is a feature. When programming in an intentionally restricted language, the question is whether the limitation in power is put to good use in some other way.