Live data from Hacker News

Scala projects are difficult to maintain

mungingdata.com

191–200 of 235 posts

Re: Scala projects are difficult to maintain

#191

Earlier quoted context omitted.

Damn dude, nice work. We've going 8 -> 11 right now and it's a pain in the butt.

What pain are you having specifically?

A former co-worker wrote a saga about trying to use modules in today’s Java ecosystem: https://www.theoryofgeek.com/articles/fomo-java-module-editi...

TL;DR: anyone doing it wrong anywhere breaks you, and it’s only a win if you feel a need to rip pieces out of your JVM.

Re: Scala projects are difficult to maintain

#192

Earlier quoted context omitted.

Why do you think Scala has more features than Java/Kotlin? I think it's the opposite. For example null: where Kotlin has a special operator and semantics, Scala simply has the "Option" type in the std lib.

Do you seriously think Scala has fewer features than Java and Kotlin?

But there is no such thing as Java. It is Java plus spring plus guava plus something else for immutables

Re: Scala projects are difficult to maintain

#193
post #18

Also Scala is not (yet) bootstrappable and the first binaries depended on proprietary software. https://bootstrappable.org/projects/jvm-languages.html https://bootstrapping.miraheze.org/wiki/Bootstrapping_Specif...

Now that's an interesting thought. Since someone was already working on a bootstrapping compiler, I suppose that's the best way, but since the JVM is so high level in general, and doesn't normally have many optimizations at the bytecode level, I almost wonder if it wouldn't be easier to start from one of the early compilers de-compiled into Java instead.

A de-compiled compiler is not something software freedom purists like the Bootstrappable Builds folks would touch with a 6-foot pole.

Their approach is to write secondary smaller implementations of the same thing in other languages and use those to build the larger thing. The seed of their bootstrap less than 1000 bytes of hand-written machine code (not assembly), and they are working on eventually reaching a full Linux distro.

Re: Scala projects are difficult to maintain

#194
I use Scala for e.g. running Hadoop map-reduce jobs or building REST endpoints. I’d never write a reusable library in Scala though for the reasons pointed out in the article, binary compatibility is not something Scala cares about.

I’m never going to use a library written in Scala for the same reason, plus chances are I’d have to spend hours fiddling with SBT to rebuild it at some point.

Scala (with Maven) at the top please, then Java all the way down thanks.

Re: Scala projects are difficult to maintain

#195

Meh, the complaints fall basically in two categories: 1. Open source libraries are sometimes not maintained which is absolutely true but also just a general hazard of the open source software ecosystem. The solution in most cases is to just not use open source libraries that are somebody's hobby project (which the author very sensibly recommends). But that is true whether you are using Scala or not. 2. Spark is weird…

Some responses: 1. Yea, but languages that are backwards compatible have libs that are useful for way longer. I can still use Java JAR files that were built with Java 8, and published many years ago. The open source libs get stale so much quicker in Scala. 2. I'd actually argue that Spark is less weird that some other dependencies. If you look at the cats README ( https://github.com/typelevel/cats ) there is this cav…

You don't have to add it, it just helps reduce boilerplate when using cats

Re: Scala projects are difficult to maintain

#196
post #108

Earlier quoted context omitted.

I think Scala needs to be treated something like how smart shops treat C++: there's so much there you can hang yourself with, so you need to define a subset/dialect and create a style guide and stick with it. This is how C++ has been successful at Google, and it's how I'd approach something like Scala if I were to go back to doing it now.

An evergreen conversation: "I love C++." —Alice "Oh? Which C++?" —Bob Every successful C++ team defines its own C++ subset.

Also Stroustrup thinks that is the way to use cpp, his talks are all about 'do not use all of cpp, pick your features'. Makes senses in a way but it does lead to various notion of what cpp is.

Re: Scala projects are difficult to maintain

#197
post #116

Earlier quoted context omitted.

Were semialgebras a right abstraction, or over-engineering? What is helpful in situations like this is the motto "as simple as possible, but not simpler". During a code review, if you see something you think is too complex, ask the author: "How could it be made even simpler? If not, how exactly a simpler approach did not work?" It sometimes helps find an overlooked simplification.

> Were semialgebras a right abstraction, or over-engineering? I think that's missing the point. The criterion should be: is the code clear enough to be easily testable, easy to debug, and easy to evolve? I will take a wrong abstraction with the qualities listed above any day of the week.

This is a good call.

The problem with wrong abstractions, though, is that they do not work, especially when you make the next step on the roadmap.

I would say that clear, testable, evolvable code with little abstraction may be fine. OTOH boilerplate and copy-paste prevents easy or well-controlled evolution. The abstractions end up inlined and fused in the code, instead of being made visible, and become easy to miss a case when a concerted change is needed.

Re: Scala projects are difficult to maintain

#198
I've been looking for a video/presentation from one of the main Scala contributors before he left the team. I think I saw it about 8 years ago. It was highly critical.

One of the main slides the stood out was discussing something like 20 or 30 different kinds of "types" in Scala. I cannot find it anymore, it may have disappeared with the political "drama" I've heard happened within Scala that included attempts to blackball people.

I've never personally coded in it, I use groovy on the JVM and it satisfies my needs but it has nothing to brag about in terms of avoiding spaghetti code.

It has all the same problems of bootstrapping any language that isn't a "X but distinctly better/easier/more features/fixes major problems in X". A big big lift.

I think only Rust is a language that is sufficiently different that has any real long term chance.

Re: Scala projects are difficult to maintain

#199

Earlier quoted context omitted.

Do you seriously think Scala has fewer features than Java and Kotlin?

But there is no such thing as Java. It is Java plus spring plus guava plus something else for immutables

All languages have their libraries and design patterns, not sure how your comment answers my question.

Re: Scala projects are difficult to maintain

#200
post #19

Earlier quoted context omitted.

8 to 11 can be a bit trickier, though. Subsequent upgrades should be boring again, but 8->9 can get interesting.

I just upgraded a spring boot app from 8 to 15, and it was seamless. It's been long enough now that most major dependencies just work with 9+ again.

Trying to upgrade stuff like Spring from 4.3 because you need 5.1 to run on Java 11+ is where we've felt the pain the most, but then we were doing some awful Spring stuff.
Post reply on HN