3 ms·
I agree in principle that one shouldn't have to understand the implementation of collections to use them effectively, but these limitations are by no means excl
by monkeyfacebag 14y ago
I agree in principle that one shouldn't have to understand the implementation of collections to use them effectively, but these limitations are by no means exclusive to Scala. Haskell's lists, difference lists and seqs work exactly the same way as Scala's list collections. Iteratively concatenating strings in Python will murder your performance. Most (all?) sufficiently complex systems involve tradeoffs.
- irahul 14y ago> Iteratively concatenating strings in Python will murder your performance. Understanding immutable strings aren't at the same level. People concatenate immutable strings all the time in Java/Python, but that is despite the documentation mentioning immutability and proper concatenation method(StringBuffer followed by toString, list.append() followed by " ".join(list))
- monkeyfacebag 14y ago> despite the documentation mentioning immutability and proper concatenation method What-do-you-know, Scala has documentation too[1]! And it mentions that appending to a List is O(n). [1] http://www.scala-lang.org/api/current/scala/collection/immutable/List.html http://www.scala-lang.org/api/current/scala/collection/immut...