6 ms·
That's not a failure of OOP, but a failure of design. This could have easily been avoided if `join` would have been a method of the list object, not the string
by nostoc 5y ago
That's not a failure of OOP, but a failure of design.
This could have easily been avoided if `join` would have been a method of the list object, not the string object. But we're stuck with this now.
- duckerude 5y agoIf join were a method on lists then you wouldn't be able to use it with other iterables. Putting it on str is more useful, if more confusing. Maybe it would be better as a standalone function. But then you'd either have to import it or it would pollute the global namespace. Other OOP models offer different solutions.
- leephillips 5y agoThe Julia join function works on any iterable whose members are or can be converted into strings.
- adgjlsfhk1 5y agoThat requires multiple dispatch.