@jorgeortiz85 Why scalaj-collection if there is JavaConversions in the std lib?
2011-09-01 04:52:13@hseeberger Because there didn't use to be. Also, because they still suck.
2011-09-01 04:54:25@jorgeortiz85 Could you please elaborate (on the last part)?
2011-09-01 04:56:04@hseeberger Ah. That's the whole reason scalaj is awesome. Use JavaConverters. (foo.asScala and bar.asJava)
2011-09-01 04:59:21@hseeberger Although JavaConverters still fails to handle boxing like scalaj-collections...
2011-09-01 05:00:36@jsuereth Why should I use asFoo? When I can get it for free using the implicits?
2011-09-01 05:01:58@hseeberger Doesn't support Comparable/Comparator <=> Ordered/Ordering or Integer/Character/etc <=> Int/Char/etc.
2011-09-01 05:05:56@hseeberger Also, foreach for-comprehensions don't work on Java collections.
2011-09-01 05:06:16@hseeberger @jsuereth Because getting it for free turns your code into spaghetti. Never use implicits to massage types that are disjoint.
2011-09-01 05:08:28@hseeberger What about something more basic: persons get "abc" where person is a java.util.Map[String, Int]
2011-09-01 05:18:56@hseeberger When I first joined Novell Vibe, they were using the magic implicits with reckless abandon. It caused massive problems.
2011-09-01 05:20:13@hseeberger @jorgeortiz85 asScala gives you one more chance for type inference and implicit lookup
2011-09-01 05:24:37@jsuereth @hseeberger @jorgeortiz85 Also a very good point. JavaConversions don't compose with other conversions. At all.
2011-09-01 05:29:04@djspiewak OK, I get the java.util.Map issue: Depending on what method you call, it behaves like a Java or a Scala Map. That's annoying!
2011-09-01 05:36:07@hseeberger Exactly. :-) That situation should be a red flag. It's a sign that maybe A doesn't belong as a subtype of B (for implicit A=>B).
2011-09-01 05:36:54@djspiewak @hseeberger I still disagree with the spaghetti... I think implicits to ease this kind of impedance mismatch is a boon.
2011-09-01 05:40:58@djspiewak @jsuereth @hseeberger @jorgeortiz85 also, scalaj converts java.util.List to a Seq not a ListBuffer (as JavaConverters does) #win
2011-09-01 05:41:31@jsuereth @hseeberger Impedence mismatch is exactly the sort of thing that implicit conversions should *not* be used to solve. :-)
2011-09-01 05:41:34@djspiewak @hseeberger You only need 'asScala' because you can't do type inference *and* auto-convert boxed types in one implicit
2011-09-01 05:41:39@jsuereth @hseeberger That's what explicit converters are for (e.g. asScala).
2011-09-01 05:41:43