4 ms·
I'm in this boat too. If you look at lot of the Scala talks from 5-8 years ago it talks a lot about why Scala is better than Java, but since then Java has copie
by rb808 6y ago
I'm in this boat too. If you look at lot of the Scala talks from 5-8 years ago it talks a lot about why Scala is better than Java, but since then Java has copied a bunch. Now Kotlin is taking over and Scala seems like yesterday's language. I've heard its really slow to compile too which makes it frustrating.
- lihaoyi 6y agoThe book's web page makes this pitch: Python-like convenience with Go-like performance, easy safety and correctness via compiler checks, and a huge ecosystem of tools and libraries. Compilation time is definitely a tradeoff, but if any of those bullet points seem interesting to you then you should definitely give Scala a serious look
- ghj 6y agoI think a better way to sell a language is to name a few concrete niches that they are amazing at. For example: C for low level systems, javascript for browser apps, bash for shell scripts, java/swift for mobile, erlang for actor models, haskell for compilers, python for ml, go for distributed systems, etc etc. To me, scala used to own the niche of "if you must use a jvm language but don't want to use java". But now kotlin is the first language that springs to mind. What would you say scala is best in class for now?
- dropofwill 6y agoI’d argue Scala still owns that niche. Kotlin is nice if you’re stuck on Android, but with the speed Java is progressing I don’t see a huge difference. Especially in 2-3 years. Also with Scala you get a best in class JS compile target, a great scripting platform in Ammonite, and Graal native image for binaries with fast startup.
- RhodesianHunter 6y ago> I don’t see a huge difference. Especially in 2-3 years. There is a huge difference now. Maybe 50% of that difference could be made up by what Java has in the planning stage. Even if it was 100%, I'm writing code right now.
- dropofwill 6y agoWhat's the huge difference? Coroutines? Boilerplate reduction? I guess there are some minor type system improvements, but its not like you're getting dependent types or anything like that.
- RhodesianHunter 6y agoIt is the sum-total of all of the little things. I could write out a list but it would end up looking like the official site's sidebar. It all adds up to making me far more productive and more sure of my code.
- theCodeStig 6y agoI agree that the alternative to Java niche now belongs to Kotlin. Scala's niche is statically typed functional programming, and category theory.
- sk5t 6y agoScala has excellent and ergonomic collections, good futures/promises, partial functions, very useful apply/unapply, scala.js, very much superior pattern matching, a much richer type system... I've used both Scala and Kotlin, and will choose Scala every time unless there's a compelling need to lower the bar, to the extent that Kotlin is less likely to get new programmers into the weeds.
- dionian 6y agoEven though Java is adopting some things which are easy to adopt, it's still a far cry from Scala. Records is probably the biggest thing to date and i havent used it much yet - but you'll still never get the fluidity of say the Scala collections in a Java compiler
- justryry 6y agoThis x1000. If you think Optional, Streams, and lambdas make Java close to Scala, you really don't know what you are missing. Some other big and small things off the top of my head: - import aliases - type members - generic variance that doesn't make you want to gouge out your eyeballs - generics over primitive types - fully unified types - an ecosystem that avoids nulls and exceptions - pattern matching - case classes - everything is an expression - immutable collections out of the box that most every library uses - higher kinded types - macros Sure, maybe Java will get import aliases 20 years after they were due but I'm pretty sure half of that list will _never_ happen. Combined they are a huge deal for productivity, expressiveness, and safety. Java can't die due to the huge existing investments and continuing to improve the language is the right thing to do, but its really well past time for folks to consider more modern languages for new projects.
- pjmlp 6y agoKotlin is taking over on Android, and going forward its FFI with Java is going to be caped to what Android allows for. Apparently there are no plans to distinguish between JVM and Android on multiplatform Kotlin, as per their latest blog post.
- richdougherty 6y agoScala missed its chance for hegemony when it changed to Java 8-only bytecode and couldn't be used on Android for several years. Then Kotlin came along and took that niche, eventually growing beyond it.