4 ms·
If you want to make a compelling argument to anyone that actually knows Scala, you need to drop the idea you can make it with scala.collections. Find another al
by ssmoot 12y ago
If you want to make a compelling argument to anyone that actually knows Scala, you need to drop the idea you can make it with scala.collections. Find another altar. This is a complete non-issue for the day-to-day Scala developer.
Outside of some pretty extreme examples (scalaz maybe), I don't think I've actually ever seen someone else's source that implemented a custom collection.
And you're purposefully trying to confuse people by digging into what might as well be "internal" signatures.
What do the actual, official docs say about SeqLike :+ ?
> def :+(elem: A): Seq[A]
> [use case] A copy of this sequence with an element appended.
Oh wow. Why does that look so much simpler than what you posted? Could it be you're exaggerating for effect and disingenuously implying that Scala developers will be routinely faced with the challenge of trying to parse such signatures? Of course you are.
Can you dig down further and find the CBF signature? Yes. Do you need to for anything outside of spreading FUD? Nope. Is it a bad thing that it shows how the sausage is made underneath the covers? I don't think so.
- jbooth 12y agoPersonally, I view the collections library as a showcase for how that language works when you're designing an API to be used for 3rd parties. If it's incomprehensible, that worries me. If the collections API is purposely trying to confuse people, blame the Scala team, not me.
- ssmoot 12y agoThat's just BS and given the size of your axe to grind, you have to know it. Akka? Spray? ScalaUtils? Do they take effort to learn? Yes. Are they anything like scala.collections? No. Why didn't you pick scala.concurrent? Or scala.util? Or any number of other packages? Why didn't you use the signatures in the official docs as-presented? The Scala team goes out of their way to present something simple and easily digestible to most programmers, even the ones unfamiliar with Type Classes. I mean, you basically just use a Seq like an immutable version of Ruby's Array and it just does what you want 99.999% of the time. How often do you see people go on to propose that because much of Ruby's Array implementation would be incomprehensible to 90% of Ruby programmers that that makes Ruby a bad language? It's an entirely ridiculous metric.
- deleted 12y ago[deleted]
- deleted 12y ago[deleted]