Reinier,
A number of DSL-heavy Scala libraries provide a more conventional API too.
I think this makes sense at least for those who are only touching on that
domain, not using it a lot. I'd rather there was some way of importing the
methods as implicit conversions or something than the library writer having
to have duplicate API.
import java.util.ArrayList.{sort => (_: java.util.List).sort}, in my
imaginary syntax, would make calls to List.sort (which otherwise doesn't
exist) end up calling ArrayList.sort. It would also need imports themselves
to be importable to be generally useful.
Hmm, I can already see hordes of people shouting this down. Possibly
including me.
On Thu, Sep 16, 2010 at 4:42 AM, Reinier Zwitserloot <[email protected]>wrote:
> This argumentation of "If you don't like the DSL stuff don't use it"
> isn't convincing, at least not for me.
>
> You can't just throw out half of a language. I have to look at code
> written by others. I want to use libraries that say "for Scala" (or
> even: "For JVM"). I don't want to wait for a library that says "For
> Scala, and, oh, we don't use those particular features you didn't
> like". That doesn't scale in a world where code is shared between more
> than 1 developer.
>
> Also, if you want accurate equals, hashCode, getters, and setters,
> then, use Project Lombok. Strings in Switch will be coming in the now
> accelerated JDK7 (It's one of the features already completed). Use
> guava for a nice collections library. The few places where scala does
> significantly more type inference than java are either rarely
> applicable, actively disliked (in my experience) by those who would
> like to "throw out the DSL stuff", or it's inference of generics in
> variable assignments, which is also coming in JDK7 (diamond operator
> is also finished and won't have to wait for 8). That's most of the
> features on that list covered already, without having to do anything
> as drastic as switching to an entirely new language.
>
>
> If you're going to go with scala, go whole hog. I don't see the point
> of using scala as a java with slightly more cleaned up syntax. It's
> not worth the trouble of switching if that's all you're going to do.
>
> On Sep 16, 5:12 am, Sean Griffin <[email protected]> wrote:
> > Ok, it wasn't my intention to change the subject...not sure how that
> > happened. Also, I think I was incorrect about setters on case
> > classes...not sure you can actually do that. It's been a few months
> > since I've actually programmed in it. I just review everyone else's
> > code these days...
>
> --
> You received this message because you are subscribed to the Google Groups
> "The Java Posse" group.
> To post to this group, send email to [email protected].
> To unsubscribe from this group, send email to
> [email protected]<javaposse%[email protected]>
> .
> For more options, visit this group at
> http://groups.google.com/group/javaposse?hl=en.
>
>
--
You received this message because you are subscribed to the Google Groups "The
Java Posse" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/javaposse?hl=en.