6 ms·
I really wanted to love Scala, and for the first few days I did. But it was a never ending story learning this language. It is so complicated and feature rich t
by itaysk 10y ago
I really wanted to love Scala, and for the first few days I did. But it was a never ending story learning this language. It is so complicated and feature rich that there's just too much to learn. I couldn't just read someone's code without stumbling on some special syntax or language feature that handles a once in a lifetime use case that I didn't know about. Eventually I gave up on Scala.
- lcw 10y agoI agree it doesn't have strong opinions and every developer has a different flavor of writing it making it difficult to code review without a ton of personal opinion type comments. That said it is a fun language because of how flexible it is too. It just, at times, does not seem practical for projects that have a ton of hands on them compared to other more opinionated languages.
- gozur88 10y agoThat was exactly my experience. Great hobby language. Not what I want to use on a professional team with a mix of capabilities.
- jshmrsn 10y agoAs others have mentioned in top-level comments, definitely give Kotlin a try, as it is specifically designed in response to your conclusion about Scala. I've been using Kotlin full-time for over a year, and I've really enjoyed it.
- TeMPOraL 10y agoMy impressions after a month spending working in it were somewhat similar. But it's not that there's much to learn (a necessary thing in a powerful tool) - it's that after that month, the language still felt like a totally inconsistent mix of every feature they could find in other languages (beside maybe sane macros, conditions and call/cc). I suppose, though, that after spending enough time immersed in a language, even such inconsistency stops being a real obstacle to anything.
- oelang 10y agoI'm surprised that you found it to be inconsistent. Care to give some examples?
- mafribe 10y agoI echo "oelang"'s request: please explain why you think scala is inconsistent. As far as I an see Scala has achieved something no other language before did: 1. For the first time, achieves a successful marriage between ML-style functional programming and class-based object-oriented programming (OOP) with subtyping a la Java. Scala achieves this by building functional programming as a special case on top of class-based OOP. Previous attempts at unification (e.g. Ocaml) tried instead to base OOP on top of typed λ-calculus. 2. Scala even improves on ML in that it fuses the language of programs with the language of module systems and brings type-inference to both (albeit partial). It fuses the two without any real compromise on each, indeed one could argue that both were improved since ML's module system doesn't have type inference. 3. Smooth integration of higher-kinded types with OO programming. 4. Having an advanced language running on the stable and well-libraried JVM eco-system. Usually languages with as much novelty as Scala, remain in academic obscurity. The unity of Scala is witnessed by the fact that it can all be compiled down to a rather simple calculus, namely "dependent object types" (DOT) [1]. I'd say that DOT is to Scala what lambda-calculus is to Haskell. I find it hard to think of another language that combines so much expressive power with being simple and coherent. [1] T. Rompf, N. Amin, Type Soundness for Dependent Object Types (DOT), http://lampwww.epfl.ch/~amin/drafts/dot_oopsla16.pdf http://lampwww.epfl.ch/~amin/drafts/dot_oopsla16.pdf
- virtualwhys 10y agoYeah, the problem is that the theoretical underpinnings of DOT do not represent Scala as we know it; that would be and is a different compiler (Dotty). If Dotty works out then we will, for the first time, have a fully specified Scala on sound theoretical footing. Along for the ride: much faster compiler, better tooling, streamlined type system, and nice-to-haves like union types and implicit function types, among other useful features.
- 10y ago
- reacweb 10y agoIn 1994, when I started my carrier, the state of computer languages was bad (IMO) and I imagined that one day I would create a new language. I had many ideas. Some of these ideas appeared in java (interfaces). I was very pleased to discovered that almost all my ideas were present in scala (the single exception is a fast compiler). It seems like a perfect language. I have tried to learn it, but failed. It takes too much time (I have 3 childs and a job). I gave up. Maybe it was caused by the complex collections system needed to support immutability. I will try again to learn it when I will have more time (??? ;-))
- caoilte 10y agoScala collections are recognised as being unnecessarily complex and are (finally) getting some love this year. http://www.scala-lang.org/blog/2017/02/28/collections-rework.html http://www.scala-lang.org/blog/2017/02/28/collections-rework...
- tutanchamun 10y agoWhat do you mean with complex collections? Did you want to write your own collection type and thus running into CanBuildFrom?
- rusk 10y agoTo me this seems like much the same malady that C++ suffers from. Is it something that established best practice could be brought to bear on? Scott Meyers' Effective C++ seems to be the bible on this topic for that language, I wonder would something similar for Scala help things a bit? I guess in Java we are spoiled - though sometimes stifling, the rigid structure and syntax help prevent people doing "bad things". It has struck me once or twice these restrictions may have been derived in part from established C++ best practices ...
- JPLeRouzic 10y agoMore than 10 years ago I was asked to provide some insights about Java and Python for internal use in our lab. Despite IBM involvement in Java at that time, both Java and Python were see as possibibly immature by my boss. My own conclusion was exactly what you wrote. In fact during the Internet bubble there was a recruiting crisis, and Java (Python was not mature enough at that time) was exactly what was needed: A language for undergraduate people that produces good results, was easy to read and maintain, while forbiding "innovative" but often buggy code.
- rusk 10y agoAnd these days its also about the tools that a strongly typed well structured language enables. I can refactor many things in IntelliJ in a trice. I've heard Bjarne Stroustroup bemoan the fact that the C++ community "can't have nice things" like this because so much of the community still holds on to legacy kludgy practices like cpp macros.
- mcguire 10y agoThe problem with C++ best practices is that they change with every version of the language. I suspect that Scala may be the same.
- grzm 10y agoNot knowing C++, what are the types of changes in practices? Which are the most burdensome? I can imagine some accompanying changes in the language (as often best practices are there to cover infelicities in the language that are corrected in future versions). Are these of a scale that require large rewrites? Like, past best practices are now actual flaws (as opposed to just not the peak optimizations)?
- pmarreck 10y agoI've been to multilanguage conferences and every time someone throws a slide up with Scala code on it, I look around me and every damn developer has this sourpuss look on their face. (Almost like when anyone brings up Node in casual conversation, but I digress...) Guys... if only experienced Scala people enjoy reading Scala code, then you kinda have an adoption problem
- the_af 10y agoUm, Scala "in the small" (for example, in a slide at a conference) is never a problem. It's 100% guaranteed to look cleaner than the equivalent Java snippet, with less boilerplate. I suspect it's snobbery if people get that look in conferences. Of course, Scala frameworks and its use in large systems might be different things -- though, having used Scala for my day job, I'd also disagree with that.
- pmarreck 10y agoFair enough. And to be honest I have not worked with it, and am probably biased by the conventions used in most other popular languages which do not carry over to Scala. It does seem like a disorganized kitchen-sink of ideas, though. And any time you allow mutability in any form (which would pretty much implicate any JVM language), you introduce the possibility of mutation bugs (one of the reasons I went over to functional langs to begin with... I once spent a month tracking down an irreproducible intermittent logout bug which ended up being based on a mutation bug).
- the_af 10y agoAgreed about the kitchen-sink of ideas. Also agreed about the mess of mutability and compatibility with JVM. But that's hardly something you'd notice looking at a slide in a conference :) I also prefer cleaner languages. But, in practice, I must choose between Java and Scala, and I'd choose the latter any day, with my eyes closed!
- pmarreck 10y ago
- gbersac 10y agoI don't really understand all those complaints. I am using it professionally since 8 month and I only had problems the first two month, then I felt good, even if there is always something else to learn. For the complexity problem, here is how I manage it : the functional programming scala is scala, everything else is garbage included for java compatibility. It works like a charm. I can't think of a language I could feel better with.
- the_af 10y agoMostly agreed. There are some pains associated with Scala, though. Sometimes self-inflicted by people who want it to be like Java: for example, most ORMs for Scala suck. A team at my office tried to use Hibernate to disastrous effects (Scala and Hibernate's hostile takeover of collections don't play well). Even some DSLs like Scalike tend to also be painful and unwieldy. I also dislike Play and its multitude of quirks and incompatible versions. It used to also be the case that both Eclipse (ScalaIDE) and IntelliJ IDEA were almost unusable with Scala, in particular constantly resulting in spurious compilation errors. I've no idea if Eclipse got better -- completely got rid of it after decades of using it with Java -- but IntelliJ did get better and mostly works (though it still cannot always compile Scalike DSLs). But even with all of the above, when I have to work with Java code again I cringe. Even with all the pain, Scala is simply better to work with for new code.
- cutler 10y agoEver asked yourself why it's taken so long for Scala IDEs to be minimally useful? The complexity of the language makes it difficult to optimise compilation and the language is still suffering. Paul Phillips left Scala because of this and he said it was impossible to rectify without re-inventing the language. This shaky complexity is why I refuse to build valuable projects with Scala.
- virtualwhys 10y agoand yet Paul Phillips still, to this day, writes Scala. Think about that, he's one of Scala's biggest critics; still Scala all day, everyday. There's nothing "shaky" about Scala's complexity, it's quite stable, and not going anywhere until Dotty lands circa 2020. Despite everything (slow compiler, average tooling, implicit/operator overloaded "magic" code bases, etc.) Scala will draw library creators (like those behind Spark, Kafka, Akka, Play, etc.) which in turn draws developers, resulting in the thriving ecosystem backing the language. Scala will live on despite itself; the ecosystem is what will carry the language to the Dotty land and beyond.
- acjohnson55 10y agoIn my opinion, the tough part is that you need to truly understand each feature. Not just one use case. Although, once you do, you can really get to work composing the features in interesting ways to get really useful effects. Like implicits + higher-kinded types to get ad hoc polymorphism. Or subtyping + pattern matching to achieve incredibly self-descriptive business logic. I would certainly agree that Scala appeals to people who like to be able to experiment and engage with more theoretical concepts while getting things done. But let's not pretend that most languages don't have this issue. Programming with major Ruby and Python libraries tends to eventually require you to learn what's going on under the hood in the same way. I would argue that once you start digging under the surface, Scala is much more elegantly designed than those languages. Go is about the only language that seems to say, "forget theory, we're simply about getting things done". Not my thing, but I understand the appeal!