5 ms·
I have been using Scala commercially for 3 years now. Never have I come across someone who didn't like it. Java veterans almost cry with joy after using Scala.
by eklavya 11y ago
I have been using Scala commercially for 3 years now. Never have I come across someone who didn't like it. Java veterans almost cry with joy after using Scala. I don't know if I live in a Scala bubble but I don't believe that's likely. And "Java will almost be Scala" nonsense never gets old it seems. It's as stupid as "Go is almost Haskell" (but they both have lambdas!!).
- incepted 11y agoScala was nice when it was the only alternative to Java but Kotlin has been slowly gaining some pretty solid momentum as a candidate for Java's replacement.
- eklavya 11y agoAssuming it's really gaining momentum over Scala I won't understand why. What Kotlin has over Scala? Compile times? After coding for 1 hour I compile once to check if Intellij and I missed something. Are those 3-4 minutes too much time?
- pjmlp 11y agoRight now, I would say the only thing it has is momentum on Android, given JetBrains relation to Studio. Using Scala on Android requires a bit more tinkering with ProGuard than Kotlin does, and it isn't a focus of the Scala designers. Also with Scala 2.12 going Java 8, one will be stuck with 2.11 for Android.
- merb 11y agoNo Android will switch to newer OpenJDK so Scala 2.12 would be a valid target.
- pjmlp 11y agoSpend some time reading the Android source code. According to Jake Warton, they only cherry picked some parts of OpenJDK 7. From the commits they also don't appear to ever fully support Java 8, only lambdas.
- merb 11y agoever is a strong word. I know that at the moment they use some parts of OpenJDK 7, but If they need to comply the Java (tm) caused by licensing, they will be forced (sooner or later) to actually don't use a deprecated JVM. As I know OpenJDK will be depracted on 2024. so it will take some time, but it will come.
- pjmlp 11y agoGiven the rumors of ChromeOS and Android becoming one OS, by 2024 it will hardly matter.
- lmm 11y ago2.12 doesn't include any (non-gated) changes though, so you can keep the same codebase and cross-build for 2.12 (for performance) and 2.11. So we're talking what, at least 3 years ("Aida", either 2.13 or 3.0) before Java 8 becomes a blocker for source-level features, at which point I imagine Android will have an answer.
- pjmlp 11y agoI doubt Google team will change, given their attitude regarding Java 8, as demonstrated at both Google IO 2014 and 2015. Also the way they are cherry picking features from OpenJDK 7 and some kind of lambda support. For me, Android Java has become similar to Symbian C++ in terms of dev experience and language fork.
- reality_czech 11y agoWell, that's the thing. If you have a small amount of code, the compile times are never a problem. Try compiling something like Apache Spark. It will be somewhere between 30-60 minutes depending on your disk speed, CPUs, etc. etc. The incremental builds are faster, but never less than 2 or 3 minutes for any change. You could potentially avoid this with the REPL, or use inotify to trigger a background compilation, but none of those really works all the time.
- eklavya 11y agoAnd yet it was written in Scala. That shows how little the compile times offset the goodies of using Scala.
- reality_czech 11y agoAt the time Spark was started, Java didn't have lambdas or closures, making the equivalent Java code for functional-programming-style ML code much more verbose. Whether the same decision would be made today is an open question (and probably depends on who you ask). A lot of other frameworks have made different decisions, such as keeping the core of the project in Java and supporting other languages as shims on top (in my opinion a more sensible decision...)
- airplane 11y agoFrom what I observed it's close enough to Java that people can easily switch and are willing to. There's also enough brevity with the language to be at ease with it daily (not as much as Scala) where it may be enough that perhaps people might not want to invest time to go all the way to Scala.
- lmm 11y agoOne of the things I love about Scala is that you don't have to "go all the way" though - you can start by writing Java-like code using Java libraries, and move on to writing Kotlin-like code as and when you want to, and move on to more advanced features than that as and when you want to.
- incepted 11y ago> One of the things I love about Scala is that you don't have to "go all the way" though This is true of any language so it doesn't mean much. Still, we went through the same thing with C++ 20 years ago. Google even used to have (still does?) a style guide saying which features to use and which ones not to use. Instead of having to use a guide that tells me which features of a language are dangerous, I prefer a language that doesn't require such a guide in the first place.
- lmm 11y agoUnfortunately it's impossible to combine that with seamless Java interoperability, because so many Java features are dangerous (null, exceptions, pervasive mutability, all of the methods on Object, finalizers, low-level thread manipulation) or at least cumbersome (use-site variance and the resulting existential types, control flow constructs built into the language syntax). I don't think there are any dangerous things you can do in Scala that you can't do in Kotlin. Only safe alternatives that exist in Scala but not in Kotlin.
- pjmlp 11y ago> Google even used to have (still does?) a style guide saying which features to use and which ones not to use. Which is a good example on how not to write modern C++, given the things they don't allow to use and not loved that much in the C++ community.
- incepted 11y agoTo me, the benefit is what Kotlin has less than Scala. It's an incremental improvement over Java and it fixes exactly all the complaints I have over Java and nothing more. Also, its IDE support is just as good as Java. But the language is not even out officially, let's see in five years how it fares. Right now, it's just a breath of fresh air over Java.
- ninjakeyboard 11y agoIt's worth noting that typesafe are prioritizing reducing compile time but it's a 32 pass compiler (!) We're working on gigantic production systems currently and with good modularization compile times are not a problem for us.
- pjmlp 11y agoHere in Germany I am yet to see any job posting about it. It is all about Java, Scala and Clojure.
- airplane 11y agoWell Kotlin isn't even officially released yet (1.0 candidate came out last week) so no company is probably using it for production yet.
- incepted 11y agoAnd even after that, it wouldn't be reasonable for any big company to adopt a language that's not at least at version 1.1 or 1.2. I don't think one can make any pronouncement about Kotlin's success or failures for several years.
- hannes2000 11y agoI wouldn't be so sure. A bunch of Android developers are severely hurt from being stuck with Java 7. I'd expect many production apps to be written in Kotlin pretty soon, about as fast as the switch from Objective-C to Swift went.
- pjmlp 11y agoScala is also an option and currently looks better on the cv. This will of course improve for Kotlin, specially if they get some Google blessing. EDIT: Also forgot to mention that on Swift's case, it is a first class language being pushed by the platform's owner, not a 2nd class language without any kind of consideration from the platform SDK.
- EdwardDiego 11y agoIt's a trivial conversion from Java to Kotlin, as opposed to Scala or Clojure, so I wouldn't expect people to be hiring explicitly for it. And the fact that 1.0 RC was just released this month might tell you other reasons why. How many Scala jobs did you see advertised when 1.0 was released in 2004?
- lmm 11y agoI'm tired of the Kotlin hype (particularly with it unreleased, and so rarely used in production). Many of its features are already part of modern Java, and its language features are very ad-hoc. I can easily see a future for Scala (it offers more radical improvements that Java will never adopt), and maybe see a future for Ceylon (it's a very clean design and the union types are a genuine innovation). I can't see one for Kotlin.
- incepted 11y ago> I'm tired of the Kotlin hype (particularly with it unreleased, and so rarely used in production) You call it hype, I call it enthusiasm. But regardless of the names we use , what I find very interesting is that Kotlin is generating such positive feelings even though it's not even 1.0. I haven't seen this happen for languages in a while (probably "ever"). What's also striking is that most of what I read about Kotlin is positive, and again, languages hardly ever generate positive feelings so widely across the board.
- lmm 11y agoDo you not remember when Java itself came out? The positive feelings ring very false to me. Kotlin has announced a lot of features long before they were delivered, and taken a lot longer to deliver a working language than they originally claimed. It's the old "two types of languages" - most languages sound good when you talk about their features, it's only when you actually use them that the negatives become apparent. I don't know anyone who's actually used both Kotlin and Ceylon and prefers Kotlin, and Ceylon is actually more mature (1.2 released recently, IIRC). But since King only advertises features that are actually implemented and release dates he can actually make, there's a lot more hype for Kotlin.
- EdwardDiego 11y ago> I can't see one for Kotlin. You can't see a future for a language that offers far more succinct code than Java, but maintains the ease of Java?
- 11y ago
- meddlepal 11y agoJava guy here. Not a fan of Scala and I've written a bunch. Love me some Kotlin though lately. Scala just feels like a language shit show. Everything from editor tooling, to the compiler, to the overly complex millions of different ways to do one thing aspect about the language pisses me off.
- pkolaczk 11y agoKotlin borrowed like 80% of mostly used Scala features and magically these features are ok in Kotlin, while in Scala they lead to millions of different ways to do one thing. Interesting.
- incepted 11y agoActually, most people who complain about Kotlin do so because they think Kotlin didn't borrow enough features from Scala. It's tough to satisfy everyone :-) The bottom line is that if you like Scala, you are probably not going to like Kotlin and that's perfectly fine. Kotlin is for everyone else and it seems to be pretty successful with that audience so far.
- Cyph0n 11y agoI'm a fan of both actually. In my view they are targeting two different use cases. Kotlin is aiming for heavier Java interop using a smaller runtime. This is a big deal for Android. Scala on the other hand is a more independent language, with much less emphasis on interop.
- reality_czech 11y agoIt's not "nonsense" or "stupid" to think that Java will adopt more Scala features over time. You have to put Java in its historical context to understand how it came to be. It was a mid 1990s over-reaction against the super-complicated, super-fragile software that people were churning out with C++. It was designed as a kind of babytalk that would avoid the complexity of speaking C++. Of course we all know it was an over-reaction, leaving behind perfectly reasonable ideas like multiple return values, lambdas, and unsigned numbers in a kind of French Revolution against C++ silliness. Scala is also an over-reaction in the other direction. It's like a cross between Perl and one of the more pragmatic ML dialects. It's easy to churn out a lot of Scala code, but hard to read someone else's or debug a Scala program. (Case in point: seeing <anonymous> for every stack frame in backtaces.) Eventually we will want to meet in the middle somewhere with regard to complexity, and Java is best positioned to do that.
- lmm 11y agoEventually we're all dead. I don't think Scala will be the best language to use in 10 or 20 years' time. I do think it's the best language to use today (and I won't be leaving it until I see an alternative with higher-kinded types, dependent types, strict evaluation, and project/dependency management as good as maven).
- Philipp__ 11y agoWe are all eventually going to die... It's not about will Java adopt more Scala features, it is about how will it look when it is all glued together. I think for Java it can only go for worse, since language is massive as it is right now. Adding more would only bring more confusion for the table. Also good question is how will it work with other components of same language. I am not programming in Scala, I mostly read about it and read it. Still on faculty, but few older friends of mine, who have finished faculty 3 years ago and started to work at local startup/small company all worked in Scala and they are amazed how good everything goes for the company and that couldn't but notice that "Developer Happiness" factor being pretty high. So all those things considered tells you something...
- pkolaczk 11y agoOn side note: Lambdas and full generics were considered in first drafts of Oak (later Java). C++ did not have lambdas those days. They were dropped from Java because of project deadline pressure and no time to do them right, not some ideology. > It's easy to churn out a lot of Scala code, but hard to read someone else's or debug a Scala program I see this argument a lot in Internet forum discussions, but I've never met anyone who actually had problem reading production level Scala code more than problem reading Java code. Sure, people love to bring on Scalaz and other extreme type-level coded Haskell-like libraries where things can get hairy, because they're solving a complex problem. These people fail to show Java-equivalent of such complex Scala code, so a conclusion that Scala was complex is invalid. However, when comparing things solving similar problems for which we have a Java project and a corresponding similar Scala project, let's say Apache Spark and Apache Hadoop, Spark's code wins in readability hands down.