2 ms·
Scala looks cool and all, but how is it better than ocaml, haskell, etc.? That isn't rhetorical.
by paulgb 19y ago
Scala looks cool and all, but how is it better than ocaml, haskell, etc.?
That isn't rhetorical.
- amichail 19y agoIt's more familiar to Java programmers and uses the Java platform. You can learn its advanced concepts incrementally starting from a familiar base. Also, it doesn't force you to program in a functional manner as with Haskell.
- bcater 19y agoBut I LIKE functional programming.
- paulgb 19y agoMe too, but I don't like being forced to program functionally if I feel imperative programming would be more readable, efficient, or fast. Certain tasks are more suited for functional programming than others. That said, I don't mind languages like Haskell where imperative programming doesn't fit in well conceptually. It's just that I wouldn't use languages like that for everything.
- jorgeortiz85 19y agoI don't have much first-hand experience with Haskell (I pretty much know only what I've read about it), so I'll address only OCaml. Scala does a much better job of unifying object-oriented and functional programming than OCaml does. OCaml's OO-system feels tacked on; an afterthought rather than a careful consideration of the original design. In Scala, a function is an object and an object is a function. There are many ways in which the line between functional and object-oriented fades. The C/Java/Python/Ruby school of syntax that Scala comes from is much more familiar to me than the ML school of syntax that OCaml comes from. Scala doesn't have the distinction between "+" and "+.": powerbook58:~ jeortiz$ ocaml Objective Caml version 3.09.3 # 1 + 1;; - : int = 2 # 1.0 + 1;; This expression has type float but is here used with type int # 1.0 +. 1;; This expression has type int but is here used with type float # 1.0 +. 1.0;; - : float = 2. Scala has access to any Java library. That said, I don't want to come across as bashing on OCaml; I'm merely pointing out some differences. OCaml is a great language (that was a joy to learn) and for many applications it can be a better choice than Scala.