20 ms·
I work JavaScript/TypeScript day to day, but I like Python syntax and easiness but also like Go's concurrency. Having learned Haskell and Rust in the past, thes
by christiansakai 7y ago
I work JavaScript/TypeScript day to day, but I like Python syntax and easiness but also like Go's concurrency. Having learned Haskell and Rust in the past, these days I appreciate simpler language.
In what way does Scala have Python's convenience and Go's concurrency? Based on talking to a few people that used Scala in the past they said they wouldn't use it again and they said I probably wouldn't like it.
- nicoburns 7y agoIf you like simpler languages, you'll probably hate Scala. It's one of the most complex out there.
- AheadOfTime295 7y agoYMMV. Some features of Scala 2.x have been dropped in Scala 3 (ETA late 2020), others added. Features we know Scala 3 will have https://dotty.epfl.ch/docs/ https://dotty.epfl.ch/docs/ A comparison of features across Scala 2.x and Scala 3 is the migration guide https://github.com/scalacenter/scala-3-migration-guide https://github.com/scalacenter/scala-3-migration-guide
- jpgvm 7y agoOn the other hand you may like Kotlin. It has a lot of what makes Scala good with less of the bits that make it bad.
- switchbak 7y agoThis is down voted, but for someone wanting to learn a Scala like language, it delivers most of the capability with less complexity and tooling problems. I still prefer Scala, but found Kotlin to be enjoyable to write as well. Probably a perfect gateway into Scala if that's an eventual goal too.
- eismcc 7y agoAgree. It’s a bag of knives. Used scala for many years at Twitter and other places and There’s always a massive combination of tooling and code reviews that eventually hammer the devs into shape.
- vips7L 7y agoKotlin is probably a better route if you're considering a non-Java JVM language. Its simple, has easy access to the Java ecosystem, and avoids the complexities of the scala FP purists.
- 9q9 7y agoavoids the complexities of the scala FP purists. Are you sure? Have a look at Arrow [1] and similar! I am glad that languages offer pure FP frameworks, so I can use them if I think they are the right tool for the job, and can avoid them otherwise. It's an important software engineering choice which style of programming to use, especially with multi-paradigm languages. But the language should not enforce them! [1] https://arrow-kt.io/ https://arrow-kt.io/
- vips7L 7y agoWhile Arrow exists I don't think its representative of the community overall.
- Psyonic 7y agoNeither is cats in Scala. Most Scala programmers are probably just maintaining Play apps or using Apache Spark, with no pure FP in sight. The pure FP contingent is just very active and vocal online.
- uDontKnowMe 7y agoUnfortunately like you say the pure FP crowd are extremely vocal online and that seeps into the culture of any company that uses Scala. Most of the visible members of the community value and advocate for fp purity and 100% type-safety at any cost, and that has a large effect on who gets attracted to learn Scala in the first place, what they consider to be good or bad code, etc. The resulting culture of firms using Scala ends up being one of pure-fp aspirational, if not pure-fp outright. Anyone who denies the superiority of a pure fp approach is constantly brow-beaten for being such a simpleton. Every time you dare use something as impure as a mutable object, or a non-const reference (so var instead of val), or even want to look up an item in a collection by index (unsafe operation since it will throw exception if index >= length) you'll have to prepare for a heckling from your team mates. Anyone you might ask help from online will first look down their nose at you for even wanting to do something so despicable, and you'll have to humour them with "well yes oh great FP lords, I know that this is really really bad I know, but I have to for .... reason, please help me anyways!".
- walkingolof 7y agoThis is one of the most persistent myths about Scala, the language itself is far smaller than, for example, Java, and its standard library is very approachable.
- AzzieElbab 7y agoScalas echosystem is overloaded with overly complex libraries that take months to learn. Li Haoyi has been trying to change that for years with his to the point open source projects. In my opinion, now is a pretty good time to get into scala with projects from Haoyi, ZIO, quill, akka, and many others that are built on strength of scala itself matured way pass being carbon copies of java or Haskell's equivalents.
- christiansakai 7y agoInteresting. Good to know.
- AzzieElbab 7y ago"In what way does Scala have Python's convenience and Go's concurrency" - I think that is exactly what the book is trying to teach you. There are some pretty good examples in the free chapters
- christiansakai 7y agoOh wow, okay I'll take a look at the book then.
- hackerm0nkey 7y agoI think the world needs, "Scala, the Good Parts". Hope this book is it.
- cinnamonheart 7y agoScala has a very wide surface area, and it can be as simple or complex as you want it to be. Written in a certain way, it's that different from writing Python 3 with PEP-484 type annotations. You can easily write Python-like code and just get things done. :) Concurrency-wise, you can implement any concurrency model you want on top of it, and, personally, I find immutability + Task-like implementations (Monix, ZIO, IO, etc.) easier to understand than CSP, but that's just me. There's also actors & channels & threads & anything else you could want. What's cool, though, IMO, is that once you need more power than just Pythonic Scala gives you, it has one of the most powerful type systems in the world; you can verify as much as you need to, and refine things over time. It's not a language that hamstrings you once you do need more power. Scala gets its bad reputation from that huge surface area and flexibility, though. There was a period (2009ish, maybe) where the Scala community was having a field day with its flexibility via custom operators like '<<++>>' and implicit conversions and untyped actors that made it impossible to figure out what was going on. It was like using the worst of Erlang with the worst of Haskell with the worst of Java. I'd say they've matured past that entirely, though; in 2020, it's one of the nicer and more practical languages, ecosystem, & communities IMO. Scala is made for getting things done.
- christiansakai 7y agoI think that's the main problem. Everyone writes Scala differently. In Go pretty much everything is quite similar. In JavaScript people also write things differently, like any other language really, but in Scala it is compounded. Is there a concrete example of the Python-like code vs the more complex ones? I appreciate the help. I'm thinking what language next should I pick up. It is either OCaml or Scala.
- lihaoyi 7y ago> Is there a concrete example of the Python-like code vs the more complex ones? I appreciate the help. Haha this book is going to be 400 pages of concrete examples. It's not out yet, so you'll have to take my word for it for the next few weeks while the last round of reviews and editing are incorporated into the manuscript. If you're interested, put your email down and I'll let you know when it's ready!
- therealdrag0 7y agoMy anecdote: if I were to go from Java to Go I would have been I impressed with its ease of concurrency, but going from Java to Scala to Go, I was unimpressed. I already had simplicity of concurrency with Scala without feeling primitive like I did with Go.
- dxbydt 7y agoI stand corrected.
- nikitaga 7y ago> So you think, hey! I get to use scala.util.Random in javascript instead of javascript's shitty Math.random() ! Woah! That is so beyond awesome. What? You can certainly use scala.util.Random from scala.js, there are very few Scala features that Scala.js does not actually support, such as blocking (because javascript) and reflection. > Because this is the scala api that the scalajs folks expose - https://www.scala-js.org/api/scalajs-stubs/latest/#scala.pac.. https://www.scala-js.org/api/scalajs-stubs/latest/#scala.pac.... . So that's fewer than 70 types. That's not everything that's available in Scala.js, those are just some stubs for smooth cross compiling. --- Scala.js is certainly not for every project. It's not a better typescript than typescript is. But typescript also isn't the right tool for every project.