Hacker News new | ask | show | jobs
by dominotw 2261 days ago
Agreed. I switched from scala to python and oh man what a relief.

Scala is a heavy weight languange. By heavyweight I mean,

1. Even intellij struggles to figure out the meaning of implicits in the given context. And then there are macros.

2. Way too many theoretical concepts, monads, monoids , isomorphisms ect that make you feel stupid. There is always a nagging feeling that you don't 'get it' when you program in scala. Here is an example of scala conference in 2020:

https://scaladays.org/2020/berlin/schedule

Features talks like these.

> a. Composition with Functional Effects

> b. Scala 3 and Abstract Algebra

> c. Describable, typesafe computations for the less monadically inclined

> d. Understanding Scala's Type System

> e. Roll your own Effect System

3. Every code base is written in its own flavor of scala.

I was spending absurd amount of time "learning scala", now i look back at that and cringe.

2 comments

Scala 3 will alleviate some of the pain you felt, for example around implicits. Scala's IDE tooling is getting better with faster compilation and language servers.

Scala is a fusion of object-oriented and functional programming. There are at least three major styles of Scala programs: OOP, functional, and reactive (actors). Scala indeed places the burden on the development team of choosing which patterns are right for them.

The theoretical concepts that you disliked are "available" in other languages too, you just don't hear about them much because functional programmers prefer languages with strong type systems. That's not to excuse the learning curve they create! I still don't understand them too well. Some of the people who do understand them will unnecessarily push them onto their projects or teams. Scala doesn't force these on you, you can ignore them. For example I write a game engine in Scala that is mostly imperative-style and has limited use of the theoretical constructs you mention.

Python's lack of a strong type system is a serious deficiency for large projects. Same with JavaScript. The costs it creates are large and often undetectable because they are the zeitgeist and death by a thousand cuts.

Ahh yes, the old “the next version will solve everything!” and the “you must be doing it wrong.”

Or... have one way of doing everything (python, go, Rust, even Java) and simplify. That simplicity means 3rd party libraries will all largely have the same basic constructs for how things work, which makes it far easier to learn, which makes it easier to contribute.

None of those languages have one way to do everything, I would even wager none have only one way to do anything.

Simplicity comes at a cost, compare Elm to Purescript/Haskell for example. Elm lacks type classes, so it’s simpler and more explicit, but that comes at the cost of verbosity and duplication. This was an explicit decision to make the language more friendly for beginners, and that’s a reasonable trade off to make, but it’s not universally better.

> Scala doesn't force these on you

Yea but one cannot write everything from scratch. I had to work on project that use cats, scalz and stuff. I felt like i was splitting an atom when i was actually writing a crud app :) .

Obsession with those theoretical concepts with dubious and unproven benefits is deeply interwoven in community. Cost of learning cats vs benefit is just absurd.

I would only recommend scala to programming language nerds that want to sound smart.

> I switched from scala to python and oh man what a relief.

I did a bit of Python, then did a bit of Scala, and now do both at work. Oh what a pain Python is! And what a joy Scala is!

> Way too many theoretical concepts, monads, monoids , isomorphisms ect that make you feel stupid.

Concepts are theoretical in their nature, aren't they? Perhaps these concepts are useful and you just haven't yet found out why?

Wrt feeling stupid, there are two possible reactions: "gee, I'm not so smart" and "whee a learning opportunity" - I'll prefer the latter anytime.

> There is always a nagging feeling that you don't 'get it' when you program in scala

Yes I have that too - so much more to learn!

> Perhaps these concepts are useful and you just haven't yet found out why?

Or maybe they are not that useful? If they were really that useful we would see those concepts everywhere.

You do see those concepts everywhere.

monads : stuff which kind of encapsulate other things, but you can still nicely manipulate both the thing and the stuff. Let's say, lists.

monoids : set of things where you kind of can add one to another. Let's say, numbers

isomorphisms : functions where there is exactly as many outputs possible than there are possible inputs. Let's say, adding 1 to a number. It's kind of useful knowing whether or not a function is an isomorphism (hello, hash collisions !).

Those concepts aren't specific to any programming language in fact, and are in fact everywhere. You just don't need to explicit them to use them, expliciting them is an option (even in Scala) which allows you to do meta manipulations on them (which Scala doesn't require, and doesn't even really suggest since none are part of the standard lib).

oh ok. Any thoughts on why scala conferences have this "Describable, typesafe computations for the less monadically inclined" but python conferences don't ?
Because doing something like that without a type system (which Python doesn't have) to guide your hand is practically impossible.

I would expect Clojure programmers (while still functional) don't use these abstractions either.

On the other hand, typed languages, like Haskell, Scala, OCaml, F#, do employ these abstract concepts. Their type system makes these worthwhile endeavour with great payoff.

Oh I was asking if they( monoids, monads ect) are everywhere like GP claimed then how come monads isn't something that talked about in clojure or python conferences. But its always talked about in scala conferences.
Oh I was asking if they( monoids, monads ect) are everywhere like GP claimed then how come monads isn't something that talked about in clojure or python conferences.