On Dec 27, 6:11 pm, "Robert Lally" <[email protected]> wrote:
>
> Tony has operator privileges on #scala,
That's because, AFAIK, he started that channel.
> With this, he is a significant and
> influential member of the Scala community and sets the tone for much of the
> IRC conversation. Feel free to insert your own favourite saying regarding
> limited numbers of apples of dubious quality and their effects on barrels
> containing larger numbers of similar, but more wholesome, fruit.
>
> Perhaps, James, your energies would be spent better on chastisement than
> apology.
Believe me, I've tried and so have many others. We've tried
educating, pleading, belittling, you name it. He literally either
doesn't understand the issue or doesn't care. The challenge with Tony
is that he's usually right about matters of fact, but usually oh so
wrong in his manner of presenting it. So instead of fixing the
unfixable, the rest of us try to go around presenting a more reasoned,
less combative approach.
> The thing that makes me most
> uncomfortable is, that I've been looking at Scala over the last couple of
> years and I still find that I can't skim across code the way I can in other
> languages. Perhaps a daily immersion in the language is required, perhaps
> I'm just not up to the job.
Scala is definitely not a language that one can skim after merely
looking at it for awhile. Scala is something you need to get your
hands dirty with. But I find the same true of the more interesting
bits of Ruby and Python and Haskell and Scheme. And can you really
skim sophisticated usage of Java generics, or deeply nested inner
classes, or crazy patterns of break/continue?
Having said that, I guess I had an advantage when I learned Scala. I
had already learned Scheme and Haskell when I moved to Scala so many
of its constructs (e.g. lambdas and pattern matching) seemed pretty
ordinary. I recognize that many Java programmers don't have
experience like that, but I think the Programming in Scala book goes a
very long way towards bridging that gap.
As for readability, I posted on my blog once a fairly indecipherable
implementation of factorial in Java using a Y combinator. Now,
obviously nobody would consider that ordinary Java, but it does
illustrate a point: it's not so much a language that's readable or
unreadable as what's written in it. Much of the hard to read Scala
code you've seen may be expressing functional "design patterns" (e.g.
monads) that you just haven't seen before in Java or at least haven't
learned as design pattern.
On the flip side of the readability coin, Scala expresses many design
patterns in a much more straight forward fashion than Java - Visitor
maps to pattern matching, Strategy often maps to first class
functions, Singleton is built into the language, etc. In a sense,
these things cease to be "patterns" and just start to be ordinary,
every day constructs. It's like if I said to you "today I
implemented a record of function references" or "today I implemented a
dynamically dispatching to a function based on on the runtime type of
the first argument." What I've just described is the essence of Java
style single dispatch object orientation, but it sounds like something
peculiar and complicated when spelled out that way.
> Having said all that, I do hope that Scala has a future in the enterprise:
> enterprise programmers are being asked to solve harder and harder problems,
> in less time, and with fewer resources for maintenance, a more powerful
> language could make a difference here. And complexity isn't necessarily a
> barrier: Stroustrup's The C++ Programming Language is 1030 pages as opposed
> to Programming in Scala's 736 .. and there's no shortage of C++ programmers
> (although perhaps that's not a good point to make since the argument FOR
> Java was that it was better than C++ due to its simplicity).
I was a professional C++ programmer for years and there are still
corners of the language I never fully grokked. But you have to do
some pretty sophisticated type level hackery to get me to scratch my
head with Scala. Once you get past wrestling with the unfamiliar,
Scala isn't such a complicated language. At the term level it's
actually roughly the same complexity as Java but its substantially
more regular, and at the type level it's only a bit more complex. On
the other hand, C++ is a far, far more complicated beast. Don't even
get me started about rules for copy constructors, the use of virtual
destructors, the precedence for type coercions, how operator
overloading is resolved, etc. Anybody who says that Scala approaches C
++ levels of complexity really hasn't used both languages.
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---