3 ms·
I think the comment simply stated that when learning a language you should focus on idiomatic code and not optimizations. The latter which is probably present a
by hvidgaard 5y ago
I think the comment simply stated that when learning a language you should focus on idiomatic code and not optimizations. The latter which is probably present and justified in a standard library.
- bborud 5y agoVery well put. (And if the standard library doesn't represent idiomatic use of the language, that's a red flag).
- vletal 5y agoTake Scala collections. These are written using builders and if-else checks of emptiness which are definitely not idiomatic. Authors of the std-lib did them for you so you do not have to. That is not a red flag.
- bborud 5y agoThe other way around: non-idiomatic use of a language in its standard library points to weaknesses in the language. If emptiness is something that is so important you add extra branchpoints inside collections to check for it, there ought to be some way of disallowing emptiness or {nil,null}ness in the language itself. Sure, it is nice for people who use the standard library, but it points to things in the language that perhaps should have been given some more thought.
- hvidgaard 5y agoI'm not sure I would call it a weakness. Performance vs expressiveness and maintainability will always be a trade off. It could be a weakness, but it's just as likely that it was a deliberate trade off.