Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Its less verbose than Go. Fact.


Do you have anything to back this up? I haven't done any scientific comparison, but my personal feeling is that Go is terser.


Yes the simplest being writing a loop to filter or map. In go you will be writing full loops and intermediate variables. I'm not going to list the go versions because I'm on mobile.

In Java:

    arr.stream().map(SomeClass::someFn).collect(toList())

How about writing a min function for all number types? In go due to no generics you'd have to write a function for every type.

In Java:

    static <T extends Number> T min(T a, T b) {
        if (a < b) return a;
        
        return b;
    }

My comment was more tongue in cheek at the guy above me for stating "facts" though.


This is the Java most haven't seen because their experience is with codebases predating the streaming-API, sometimes even generics.

The death of Java will be Scala-written dependencies in the Maven-packages ecosystem ending up as a liability.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: