3 ms·
Scala is nowhere near as approachable as Python or Typescript
by pbourke 6y ago
Scala is nowhere near as approachable as Python or Typescript
- valenterry 6y agoWhy do you think that?
- pbourke 6y agoScala’s implicits, mutable/immutable collection bifurcation, infix/dot syntax interchangeability for method invocations, tendency of libraries to implement their own mini language, ...
- valenterry 6y agoAs a beginner, you don't really have to use Scala's implicits or "infix/dot syntax". Just like how you don't have to use type annotations, generators, decorators, context managers in python. Same for libraries. At some point you will stumble upon a library that forces you to understand them or you even write one yourself, but that is not something that stops you in the beginning.
- random5634 6y agoIt does. Go got this right. If you want to read code, contribute to a large code base, folks will be using the features of the language, including the weird ones. Go has kept things very simple (relatively) in terms of core language. Some things were beyond basic (error handling? no generics?) But boy did it make it easier for contribute and understand code. def Hi() = "hi" Hi() Hi Yes, those two variants both work?
- valenterry 6y ago> If you want to read code, contribute to a large code base Sure, but in that case, is python really beginner friendly? I don't think so. I had the impression we were talking about starting out with the language and building the well-known todo-list to learn the basics. Also, golang is a rather young language and it will go the way that all languages go: it will get more and more complex because the more experienced developers want to improve their productivity with better language features. Remember the "no generics" thing? Well, now the generics will be added - I predicted this to happen. And just wait, other features will follow...
- random5634 6y agoIt was originally. But agreed, less so now. They've been adding some really more edge / line noise type features. Consider the walrus operator? You can do pretzel magic with this which make figuring out scope and what happened to what difficult. I love the old way. with open(…) as f: for line in ... And I wish they'd just made more things iterable maybe or fixed some of the regex match stuff?
- benhoyt 6y agoAt least when I used it ~2 years ago: an extremely complex type system with a huge learning curve (unless you're going to just write Java in Scala), poor documentation, and a very slow compiler. That's to say nothing of the JVM-based runtime.
- doliveira 6y agoI got really frustrated one of these days because I reached the 20-something limit for fields in a case class and I had to change a lot of my architecture. It was a Spark job so I needed all those fields in that structure. Not sure if that's because I'm a beginner or if it's just Spark itself, but Scala errors are impossible to decrypt.
- valenterry 6y agoAh yeah, that was really a stupid limit. Time to bump Scala to version 3 so that you don't have the 22 case class field limit anymore. :) See here: https://dotty.epfl.ch/docs/reference/dropped-features/limit22.html https://dotty.epfl.ch/docs/reference/dropped-features/limit2...
- valenterry 6y ago> unless you're going to just write Java in Scala That is what I mean though - but I would replace "Java" with python here. Just stay away from all the complexity and write python code. It's pretty simple and some people argue it's the better way to use Scala.