On Wed, Aug 25, 2010 at 12:05 PM, Ben Schulz <[email protected]> wrote:
> Sure, how about this:
>
> var y = -1; // why the initialization?? so complicated
> if(x > 5)
> y = x;
> else
> y = 5;
>
> versus
>
> final int y; // ahh, definite assignment, so simple (*)
> if (x > 5) {
> y = x;
> } else {
> y = 5;
> }
>
This is somewhere Java actually beats Scala in terms of chars:
int y = x > 5 ? x : 5;
vs:
val y = if(x > 5) x else 5
But then Scala comes in and wins the day:
val y = 5 max x
> Then there's the security aspect.
>
> private[yourscopehere] def getRootAccess() = {
> // this better not be public
> }
>
> I'm sure there's more, but I'm also sure the rules are about to shift
> in Scala's favor. Again.
>
> With kind regards
> Ben
>
> (*) Generally I would list definite assignment as making Java more
> complicated, but sine the code is more concise and closer to the
> intent....
>
> On 25 Aug., 08:55, Kevin Wright <[email protected]> wrote:
> > http://michid.wordpress.com/2010/08/24/so-scala-is-too-complex/
> >
> > <http://michid.wordpress.com/2010/08/24/so-scala-is-too-complex/>I'm
> > curious, does anyone have an example of the same problem being solved in
> > both Java and Scala, with Java offering the simplest solution?
> >
> > --
> > Kevin Wright
> >
> > mail/google talk: [email protected]
> > wave: [email protected]
> > skype: kev.lee.wright
> > twitter: @thecoda
>
> --
> 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.
>
>
--
Viktor Klang,
Code Connoisseur
Work: www.akkasource.com
Code: github.com/viktorklang
Follow: twitter.com/viktorklang
Read: klangism.tumblr.com
--
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.