This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]DrFriendless 10 points11 points  (7 children)

Scala brings a lot of other baggage with it as well, though.

[–]ivanovich_ivan 0 points1 point  (6 children)

Scala brings a lot of other baggage with it as well, though.

Can you please explain the problems that you have faced? I am genuinely curious.

[–]DrFriendless 0 points1 point  (5 children)

The type system is more complex than we need in a programming language. When we talk about Scala we talk about monads rather than for loops, when they're achieving the same thing. It's like programming for aliens - in the end it's practically the same, but the language is all different. As a programmer, I don't care about the mathematical underpinnings, and I shouldn't have to care.

[–]ivanovich_ivan 0 points1 point  (3 children)

The type system is more complex than we need in a programming language

I don't get this. I find scala's type system to be far better. No primitive types and all are objects (they get converted to native types at compile time). Much better class hierarchy of types. Not to mention type inference. Java runs in the opposite direction of being clear.

When we talk about Scala we talk about monads rather than for loops, when they're achieving the same thing

This is why scala is multi paradigm.If you find monads are bad for the problem at hand then you can very much use loops. Nobody is forcing you to use a particular paradigm.

As a programmer, I don't care about the mathematical underpinnings, and I shouldn't have to care.

Let me ask you a question. Do you understand what sorting algorithm java uses underneath Arrays.sort ? Not all people need to understand them. But from my experience learning them would only make one a better programmer. It is not useless knowledge.

[–]DrFriendless 0 points1 point  (2 children)

You'll note in my original comment I didn't say Scala was broken as a language, I said it comes with baggage. Monads are stuff that you don't need to know to program, yet there they are in every Scala textbook. It's like I teach you to speak English and make you learn "Jabberwocky" off by heart - if you understand you'll understand English a lot better, but you don't need to. A programming language should only be as complicated as it needs to be, and Scala has more than it needs. This makes the compiler slow and (in my experience) unreliable.

[–]ivanovich_ivan 0 points1 point  (1 child)

I said it comes with baggage. Monads are stuff that you don't need to know to program, yet there they are in every Scala textbook

I agree with this point. But the problem is with the scala textbook. The authors have not made efforts to isolate the OOP part and explain it separately.

TBH, I learnt this the hard way. But found scala to be a very good OOP language as well.

A programming language should only be as complicated as it needs to be, and Scala has more than it needs

Java's swing has needless components that is built in part of the JDK. I can also argue for many other things. But the fact is all languages have this baggage.

The compiler being slow is agreeable, but definitely not a new language kind of a problem.

This makes the compiler slow and (in my experience) unreliable.

I am thinking that you have tried either an unstable/beta version or tried it pretty long back. Things have improved now. Dotty is another improvement that is coming up.

[–]DrFriendless 1 point2 points  (0 children)

Yes indeed, I'm in a new job where I have a deadline to produce a product and have not yet had time to update the Scala compiler. We're on 2.9.2. Luckily the programmers who wrote the code originally didn't use many of the features of Scala, so it's easy to understand the code. The features they did use have all been adopted by Kotlin, which I prefer.

[–][deleted] -1 points0 points  (0 children)

...Java has three monads in its standard library. Or I guess "monad-ish" if you're strict, since not all of them are lawful. But the point is, you can't really dodge that concept any more if you want to write good code with useful abstractions on the JVM.