News for hackers. Stuff that matters.
Re:Metabase: Why we picked Clojure by toong on Wednesday December 02, 2015 @05:19PM (#10666278)
That's not a fair comparison. What about:

IntStream.range(0, 100).filter(i -> i % 2 == 0).collect(Collectors.toList());

Disclaimer: I'm not writing Java nowadays, so this is my quick prototype from a quick google-session, it probably won't compile :D

Edit: looks like I'm second, my google-session took too long :-)

Maybe bonus points for C#: Enumerable.Range(0, 100).Where(i => i % 2 == 0);

Re:Metabase: Why we picked Clojure by pmelendez on Wednesday December 02, 2015 @05:38PM (#10666390)
True... although that is to me even less readable than the first Java version. The clojure version still wins by a large distance in my book because of its elegance.
Re:Metabase: Why we picked Clojure by dkersten on Thursday December 03, 2015 @07:12AM (#10669166)
That's not bad, but in the clojure version, I have to know/learn three functions: filter, even? and range

In the Java version, I need to know/learn IntStream.range, IntStream.filter, IntStream.collect, the even lambda, and Collectors.toList

Of course, this is comparing one-liners, so doesn't necessarily translate to larger programs. Just pointing out that I don't find this one particular example to be in Javas favour.

Re:Metabase: Why we picked Clojure by highCs on Wednesday December 02, 2015 @06:05PM (#10666556)
> IntStream.range(0, 100).filter(i -> i % 2 == 0).collect(Collectors.toList());

This has been added to java to catchup with functional programming languages.

Re:Metabase: Why we picked Clojure by toong on Thursday December 03, 2015 @05:52AM (#10668926)
I know those are functional concepts, but it feels more like trying to catch up with C# (LINQ) to me.
Re:Metabase: Why we picked Clojure by yogthos on Wednesday December 02, 2015 @05:43PM (#10666422)
That's better, but Clojure still has less noise, and in my experience that adds up significantly in the long run.
Re:Metabase: Why we picked Clojure by toong on Thursday December 03, 2015 @05:56AM (#10668935)
Less noise, true. But the grand-grand-parents' point is that some of that noise provides context, which (arguably) improves readability.
Re:Metabase: Why we picked Clojure by yogthos on Monday December 07, 2015 @06:47PM (#10693712)
The examples don't support that assertion though.