News for hackers. Stuff that matters.
Re:The Play Framework at LinkedIn by dxbydt on Thursday February 21, 2013 @02:21PM (#5259493)
>... Scala...definitely not for functional paradigms

I am sorry, what ?

Re:The Play Framework at LinkedIn by chimeracoder on Thursday February 21, 2013 @02:27PM (#5259544)
I could probably copy-paste this comment from any one of the many other Scala discussions where this has come up, but in short:

Scala isn't functional; Scala is proper (pure) OO in a way that Java never was. Scala doesn't support top-level functions (only singleton objects), which doesn't exactly prevent it from being functional, but certainly suggests that the primary paradigm is still object-orientation.

It just so happens that pure OO, when properly done, happens to embody a lot of features similar to functional programming - Smalltalk is the easiest example of this (eg. the similarities between Smalltalk message passing and Haskell's implicit currying are very clear).

The reason for this is that it's trivial to create a good object system in a purely functional language, so the FP-OO relationship isn't an either-or so much as a 'special case' (ie, OO can be seen as a 'special case' of FP). The converse isn't so true; it's hard and clumsy to build a truly functional paradigm within an OO paradigm.

What GP probably meant is that Scala isn't a good choice for those who are coming from an FP background, since they'll likely notice that Scala seems very OO by comparison (because it is). Even on the JVM, there are other languages (ie, Clojure) which embody functional paradigms more transparently. On the other hand, Scala is a decent choice for OO programmers who want to get a taste of functional programming (or who want to incorporate those paradigms into their code), because Scala allows several aspects of the FP paradigm to come through as well.

Re:The Play Framework at LinkedIn by jorgeortiz85 on Thursday February 21, 2013 @03:30PM (#5260142)
"Functional programming" is one of the most ambiguous and misunderstood terms in software.

If you ask someone coming from ML or Haskell, Scala is more "FP" than Clojure.

If you ask someone coming from Lisp, Clojure is more "FP" than Scala.

Ultimately, it doesn't matter what you call it. Pick your tools based on what they do, not on what other people call them.

Re:The Play Framework at LinkedIn by nessus42 on Thursday February 21, 2013 @07:11PM (#5261605)
> Scala doesn't support top-level functions (only singleton objects)

This is neither here nor there. Scala has "package objects" and functions put into a package object are scoped directly at the top level of the package. They are not nested within any other object. The only downside to this that I can see, is that at the moment, a package can only have a single package object, which means all the top-level functions for the package have to reside within a single file.

Re:The Play Framework at LinkedIn by sixbrx on Friday February 22, 2013 @07:05AM (#5263837)
Technically Scala does support top-level functions, because a top level singleton object can extend FunctionX[...]. It just doesn't support the short "def" form of declaring them at the top level.
Re:The Play Framework at LinkedIn by epsylon on Friday February 22, 2013 @09:40AM (#5264343)
> OO can be seen as a 'special case' of FP

That's quite a claim you're making here. I, on the other hand, pretend that object-orientedness and functionalness are orthogonal concepts.

Re:The Play Framework at LinkedIn by slurgfest on Thursday February 21, 2013 @02:53PM (#5259816)
Is there any objective basis for saying that Clojure is "better" than Scala?
Re:The Play Framework at LinkedIn by chimeracoder on Thursday February 21, 2013 @02:57PM (#5259853)
Not "better" as a language - "better" at exhibiting functional paradigms more transparently. I've fixed the wording.
Re:The Play Framework at LinkedIn by SourPatch on Thursday February 21, 2013 @06:21PM (#5261319)
What do you mean by that? Scala supports closures, currying, immutable data structures, recursion. I'm failing to see how these concepts are less obvious in Scala.
Re:The Play Framework at LinkedIn by ratpik on Thursday February 21, 2013 @02:24PM (#5259528)
Typed out too soon. Meant it is a good reason but not the only language with that reason unless you wish to stick to the JVM.