News for hackers. Stuff that matters.
Re:Python overtakes Java to become the second-most popular p... by vips7L on Thursday November 05, 2020 @10:53AM (#24999279)
> I'm writing some Java at the moment for an Android app, and it's just killing me after doing Scheme and Python

Android isn't Java though. It's some frankenstein contraption made from a mutated version of Java from a decade ago.

> I were starting my own business now, I'd use Clojure or Scala.

I personally wouldn't ever choose Scala for anything. It's tooling is horrible (Sbt is a special hell, and scalac is as slow as a C++ compiler).

I'm currently in a code base like you describe, scala core with a switch to Java. It's not fun. Were stuck with these legacy library and framework choices that don't fit into the Java ecosystem and it slows down development considerably.

Re:Python overtakes Java to become the second-most popular p... by pkolaczk on Thursday November 05, 2020 @01:31PM (#25000634)
> ... and scalac is as slow as a C++ compiler

Scalac is as fast as Javac if you don't overuse Scala-specific features which are known to compile slowly - implicits and macros. But it is unfair to use these features and than complain on compile speed or compare it to a language that doesn't offer similar feature set.

Also, in our Java/Scala project it turned out that Scala+Bloop was way faster (10x-100x) at incremental compilation than Java+Gradle. Bloop is based on SBT libraries so there are some things that SBT does right.

Re:Python overtakes Java to become the second-most popular p... by jvican on Thursday November 05, 2020 @02:59PM (#25001397)
Thanks for the compliment. But, as the author of Bloop, I must say that Bloop is definitely not based on sbt and it departs a lot from the design decisions sbt made.
Re:Python overtakes Java to become the second-most popular p... by suyash on Thursday November 05, 2020 @09:18PM (#25004240)
Android is the worst implementation of Java projects - horrible architecture or lack thereof and really bad api design. If anyone wants to learn Java, focus on modern Java language and micro services based frameworks and you can get best of all.
Re:Python overtakes Java to become the second-most popular p... by iainctduncan on Thursday November 05, 2020 @11:21AM (#24999499)
Interesting, I've only read Scala. Personally I like Clojure but thought I should mention it as I see businesses mixing Scala with Java successfully in my work.
Re:Python overtakes Java to become the second-most popular p... by dbsmith83 on Thursday November 05, 2020 @12:58PM (#25000354)
You can, but interoperability is not that great. It can work, but often it takes a lot of massaging/converting even basic data types.

Kotlin has wayyy better interoperability with Java

Re:Python overtakes Java to become the second-most popular p... by jjtheblunt on Thursday November 05, 2020 @11:45AM (#24999685)
totally agree about sbt being gratuitously complex.

i wonder if Java is judiciously choosing the non crazily digressive parts of Scala, as they both evolve.

Re:Python overtakes Java to become the second-most popular p... by vips7L on Thursday November 05, 2020 @12:27PM (#25000050)
That is what Goetz said is the plan for Java. Move slow, let other languages experiment with language features, and then take the best features and implement them better.
Re:Python overtakes Java to become the second-most popular p... by eecc on Thursday November 05, 2020 @01:59PM (#25000872)
Well, so far the “better” still remains to be seen... waiting for type-classes to represent monoids, functors, applicatives, monads and foldable.

So far I’ve just seen a complex and wild stream API that mimics it in practice, without all the mental model behind it.

Oh, and what’s this nonsense with Java Option?! Really?

Re:Python overtakes Java to become the second-most popular p... by vips7L on Thursday November 05, 2020 @07:57PM (#25003798)
We're yet to see if monoids, functors, and monads are worth it :)

For better I'd say you should look at things like virtual threads vs async/await or kotlins when vs switch expressions.

Re:Python overtakes Java to become the second-most popular p... by dtech on Friday November 06, 2020 @08:50AM (#25007558)
If you program modern Java or Kotlin map and flatMap are everywhere. I'd say the debate whether functors and monads are useful is over.
Re:Python overtakes Java to become the second-most popular p... by _old_dude_ on Friday November 06, 2020 @09:42AM (#25007889)
Java or Kotlin support functors or monads as design patterns, i.e. this is how a map/flatMap works with an Optional or a Stream.

The question is: if this support is enough or should the type system be enhanced so you can abstract over/compose a functor and/or a monad ?

The answer to this question is IMO still open.

Re:Python overtakes Java to become the second-most popular p... by eecc on Saturday November 07, 2020 @03:23PM (#25018856)
No they are. Seriously, the mental effort I had to endure to hold all these wild APIs in my head! In hindsight it’s infuriating; the gatekeeping, the patronizing condescendence when I was struggling with what are mathematical trivialities.

Screw that... I should have been told sooner

Re:Python overtakes Java to become the second-most popular p... by jjtheblunt on Thursday November 05, 2020 @01:55PM (#25000845)
Nice : as an ex Scala person for a few years, seems smart.
Re:Python overtakes Java to become the second-most popular p... by therealdrag0 on Thursday November 05, 2020 @01:50PM (#25000793)
Sbt optional right? Can use maven or whatever else of you want.