Comment by ecshafer

Comment by ecshafer 3 days ago

26 replies

Scala isn't as hot as it used to be. I think the rough Scala 2->3 transition, coupled with improvements in the base Java language, emergence of Kotlin + Android support, and popularity of Python in data science and data pipelines (lets just do everything in one language became popular) kind of made Scala not quite as popular as it could have been. Plus the long compile times are a pain. However it seems to have a really high coolness ratio for a language. The few jobs I do see in Scala are very cool looking. Very few boring looking jobs.

mikert89 3 days ago

Scala is too complicated. Most scala code bases I have worked on have no enforced structure, the language allows for all sorts of unconventional programming paradigms

  • Boxxed 3 days ago

    Yeah I love it when people start defining their own operators all over the place and give them all inscrutable names. "Dude just use the eggplant parm operator: <<=-=>>"

    • nikitaga 3 days ago

      ^ This meme is from 10+ years ago when Scala was at the peak of its hype driven by the FP craze. Nobody seriously writes cryptic-symbolic-operator code like that nowadays. Scalaz, the FP library most notorious for cryptic operator/method names, hasn't been relevant for many years. Today everyone uses Cats, ZIO, or plain Tapir or Play, all of which are quite ergonomic.

    • ecshafer 3 days ago

      This is the type of thing that a good PR review culture will handle. I love that this is an option in some languages. But in a company, you need to decide what cool features should be used and when and how much.

      • fjordofnorway 3 days ago

        Good PR review isn't really enough unless the organization is only large enough to handle around one PR at a time.

        With languages like Scala I think its a clearer necessity that someone or some small group in an organization maintains a dominance of expertise or you have different groups that are only using the same language in name or facing overhead to keep in agreement where a lot of the best developers might be basically doing ambassador work.

        • mikert89 3 days ago

          yeah a small group of experts can leverage scala, its not a language for a corporate environment

    • shawn_w 3 days ago

      One reason why I keep bouncing off of Haskell.

  • packetlost 3 days ago

    That's sorta the curse of Lisps too.

    • slifin 3 days ago

      Yeah sorta

      I would say Clojure is a big exception to that - Clojure applications tend to be more uniform than even non lisps

      • packetlost 2 days ago

        Clojure is an exception to pretty much everything in the category. I really wish I had the opportunity to use it in my professional career.

  • frakt0x90 3 days ago

    This is exactly what turned me off. It supports so many paradigms that every line of code I wrote I had to sit and think if I was doing it the "right" way and it was miserable.

    • eweise 3 days ago

      Part of that I think is the culture and not the language. Personally I try to use the least powerful method that gets the job done and that usually keeps me unblocked. In practice that usually means using it as a better Java and not going down the functional monad path. I know scala has gone through a rough patch and maybe migrating from 2 to 3 is painful. But if you try starting a new project now with the latest Scala 3, I think you'll find that its pretty nice. Even IDE support is pretty good.

  • another_twist 2 days ago

    I think its because we dont have too many established paradigms for functional programming. Having said that I think Scala is just marvellous. I had to work with a Scala codebase written by a set of very mature devs and it was an absolute joy. It influenced how I write Java.

yearolinuxdsktp 3 days ago

Scala’s downfall is the culture of writing libraries with the most esoteric syntax imaginable. It’s the opposite of Ruby’s “program with pleasure”—-it is “program with maximum cleverness” and “if it doesn’t look like an obscure math equation or symbol soup, it’s probably not idiomatic Scala.” Java’s designers were opposed to operator overloading due to potential for abuse, and did Scala deliver living proof/nightmare scenario of that.

Now I still want operator overloading, because I favor enabling instead of disabling approaches, and I want, for example, new numeric types to have natural syntax that blends in with built-ins, or an equality operator that works consistently. I’ll even settle for += append to strings and collections.

But even Scala standard libraries take operator use to wild extremes. Apparently it’s not enough to use + to append collections, you must use ++. Except Vec you can add with +. There’s ++= and ++=:, and /: and :: and ::: and ?^ and ?^.

Spark Scala interface introduces =!= for inequality comparison. There’s |@| from Cons library. Don’t get me started on Akka. SBT introduces <++=

Surprisingly you can’t override ==, so Spark implements ===. And specs2 testing library implements ====.

  • hocuspocus 3 days ago

    I've onboarded experienced and inexperienced developers to fairly big Scala codebases for the best part of a decade and I can't think of a single time symbolic operators were brought up as a source of complexity of confusion. Sbt deprecated <++= 10 years ago.

    • bearforcenine 3 days ago

      Agreed. There was a period of time roughly 10-15 years ago where symbolic operators in Scala were very en vogue. That fell out of style in a big way and I haven't encountered symbol soup in a very long time.

      Most of the conversations I have with folks about Scala issues these days center around implicits, tooling, and its decline/lack of popularity.

Scubabear68 3 days ago

You got it. Scala had a shot being an early mover in the JVM functional programming space, but they really shot themselves in the foot with their version transition problems and tooling issues you allude to. Java is probably "good enough" for most shops now, and if you are not bound to the JVM I really don't understand why you would go with Scala today.

  • hocuspocus 3 days ago

    Scala's decline started before Scala 3, which brought its share of breakage (sometimes for dubious reasons, like the new syntax) but also fixed many warts. Tooling has improved a lot lately, but it's too late.

    > if you are not bound to the JVM I really don't understand why you would go with Scala today.

    Scala's metaprogramming abilities coupled to a powerful type system are still unmatched. Among mainstream languages, only TypeScript gets somewhat close. For your typical service oriented architecture, libraries such as Tapir or ZIO HTTP are pretty nice. I haven't found anything as pleasant in other languages.

    That said if an LLM can write 95% of your code today, this point is a bit moot, sadly.

    • ndriscoll 3 days ago

      It's not really moot though. The primary benefit of concise but robust frameworks like ZIO is that they are easy to read (like the program is mostly business logic with minimal syntax noise/programming language bookkeeping), not that they're easy to write (though that's true too). Metaprogramming also works nicely with LLMs because you get the expressiveness of something like Python (or better) while retaining a strong type checking layer to give a feedback loop to the LLM. In fact, it kind of shines with an LLM because you largely don't care if things like macros are ugly as long as they produce correct code to present to the typechecker/compiler, so it makes more sense to vibe code the metaprogramming layer to give yourself whatever you need to have straightforward business logic. Conciseness and direct encoding of business logic also helps to keep context focused.

      Really this is all true with humans too, but IMO it's multiplied with LLMs because they are insanely capable at dealing with the guts of metaprogramming wizardry if they need to, so you don't end up in a world where that one guy that understands it leaves and then no one can possibly maintain it.

bdavisx 3 days ago

I haven't used Scala for quite a while now - but a while back they had a serious asshole problem with a lot of the community.

mark_l_watson 2 days ago

I agree. I took Martin's fantastic online Scala class way back when and I was a fan. Now Clojure is a great JVM alternative, and as you say Java has kicked it up a notch.

sh3rl0ck 3 days ago

What would you categorise as a "cool looking job"?

  • ecshafer 3 days ago

    Jobs that you work on hard, complicated things. Scala is relatively popular in Fintech and Finance in general. There's things like Chisel or Spark. But there are relatively few simple CRUD app companies using Scala.