News for hackers. Stuff that matters.
Re:Python’s tug of war between beginner-friendly and advance... by valenterry on Thursday February 04, 2021 @08:32PM (#26032015)
Scala comes very close to that.
Re:Python’s tug of war between beginner-friendly and advance... by pbourke on Thursday February 04, 2021 @09:15PM (#26032289)
Scala is nowhere near as approachable as Python or Typescript
Re:Python’s tug of war between beginner-friendly and advance... by valenterry on Thursday February 04, 2021 @10:08PM (#26032605)
Why do you think that?
Re:Python’s tug of war between beginner-friendly and advance... by benhoyt on Thursday February 04, 2021 @10:18PM (#26032673)
At 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.
Re:Python’s tug of war between beginner-friendly and advance... by doliveira on Thursday February 04, 2021 @10:50PM (#26032891)
I 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.

Re:Python’s tug of war between beginner-friendly and advance... by valenterry on Thursday February 04, 2021 @10:58PM (#26032941)
Ah 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/limit2...

Re:Python’s tug of war between beginner-friendly and advance... by valenterry on Thursday February 04, 2021 @10:57PM (#26032931)
> 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.

Re:Python’s tug of war between beginner-friendly and advance... by pbourke on Thursday February 04, 2021 @10:29PM (#26032760)
Scala’s implicits, mutable/immutable collection bifurcation, infix/dot syntax interchangeability for method invocations, tendency of libraries to implement their own mini language, ...
Re:Python’s tug of war between beginner-friendly and advance... by valenterry on Thursday February 04, 2021 @10:56PM (#26032925)
As 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.

Re:Python’s tug of war between beginner-friendly and advance... by random5634 on Thursday February 04, 2021 @11:24PM (#26033081)
It 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?

Re:Python’s tug of war between beginner-friendly and advance... by valenterry on Friday February 05, 2021 @12:23AM (#26033402)
> 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...

Re:Python’s tug of war between beginner-friendly and advance... by random5634 on Friday February 05, 2021 @03:32PM (#26040833)
It 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?

Re:Python’s tug of war between beginner-friendly and advance... by ledauphin on Thursday February 04, 2021 @09:09PM (#26032252)
the JVM is an incredibly heavyweight runtime compared to CPython. I don't think we're going to find the next beginner-friendly language coming out of the most professional runtime in human history.
Re:Python’s tug of war between beginner-friendly and advance... by valenterry on Thursday February 04, 2021 @10:12PM (#26032629)
True, but I don't think that is what the OP was taking about. The language itself is rather independent of the runtime. Scala compiles to native code or Javascript as well.
Re:Python’s tug of war between beginner-friendly and advance... by pbourke on Thursday February 04, 2021 @09:17PM (#26032305)
> incredibly heavyweight runtime

The apps may be heavyweight, but the runtime was designed to run on set-top boxes 25 years ago.

Re:Python’s tug of war between beginner-friendly and advance... by jaytaylor on Thursday February 04, 2021 @10:00PM (#26032558)
The JVM is definitely memory hungry (excluding cherry-picked examples such as 'set top deployments' or the Java Ring from the 90s), moreso than any other language runtime referenced in this discussion.