I’m super interested in functional programming. I like that Twitter has so many backend Scala teams. But I’m wondering how it works in practice. So, is it FP utopia or is it just like any other job?
Scala is nice, but far from utopia. Scala 3 is promising if it gets enough backing
What would tou say are the major sore points for you? For context: I’m working in deeply OOP C++ right now.
Mostly as a more expressive Java. At the rate Java is moving, it will probably be “good enough” such that there will be little point to pay the pain to adopt Scala in an existing codebase
How about Kotlin? @Stripe and @Apple
My impression of Scala is that there tends to be a few people in every group who get completely carried away with it and write code that nobody else can understand.
Lol
Any examples of what that looks like? I’ve seen similar with OOP in C++.
Get rust and RIP.
Spark keeps Scala alive but Spark also keeps Scala from progressing, the duality of Scala.
Tell me you don’t develop in scala without telling me you don’t develop in scala Papapuff goes first
Scala is write only language, unless used in moderation
Lol!
Scala is not a pure FP language if that's what you're looking for. Part of the beauty of Scala is that it's not which means you can still use very FP oriented code while not having to train everyone up on full category theory. Basically an FP-lite language that works easily in real world situations. If you do want more on the FP side in Scala you'll need to move into the Typelevel system or the ZIO framework which are both pretty great but introduce some headaches of their own.
One overlooked problem with Scala is the poorness of third party packages. I’ve spent shitloads of wasted time on things like Blaze and Spire trying to get anything close to Python analytics & math ecosystem to avoid Spark or other map reduce-like frameworks for scientific computing. Just try to reproduce some matplotlib functionality for plots in Scala. It’s mindblowingly horrible and usually bottoms out with “write all your own complex wrappers around JFreeChart” or “here’s a shiny new Javascript interface that can plot sexy force graphs but you can’t make a bar chart.” You can swap out scientific computing or plotting above and replace with your special domain interest of choice and the same problem happens constantly. I can research, write, test, debug, harden for production, load test for optimization and deploy something to receive real production traffic in Python, all in the same amount of time I can barely even _find_ relevant third party packages and fight through installation and compiler issues just to trial it in Scala. Then add on how much more poorly maintained the packages are in Scala, lots of abandonware and years-old critical bugs or missing capabilities. IMO it’s a total dealbreaker. You are 100% always better off purely using Java if you want that ecosystem.
Twitter is supposed to be moving to Java for its core code, but some services will remain Scala and there probably won't be much converting. I expect there to be a ton of inter-op mess for awhile
Interesting. What’s the reasoning?
Mainly that more people know Java so it's an easier rampup and already has a very high adoption. I was rooting for Kotlin but alas.
The Java ecosystem can still be a headache
Why. Curious
Conflicts from dependence versions and other build nightmares