News for hackers. Stuff that matters.
Re:Java 8: No more loops by CmonDev on Monday January 12, 2015 @10:37AM (#8874403)
I guess this is why Microsoft diverged from the "standard" names like 'map', 'collect' and 'filter' in favour of more human-oriented SQL-like LINQ: 'select', 'where', 'toList'.

I have to read the underscore.js documentation every time I am using it :(.

Re:Java 8: No more loops by api on Monday January 12, 2015 @10:41AM (#8874426)
MS did the right thing. A huge barrier to FP adoption is the unnecessarily obtuse terminology. In playing around with FP languages I often find myself having to re-look-up basic syntax because the terms are simply so obtuse that they won't "stick" in my head.

I think it comes from FP's rooting in mathematics, and math is itself unnecessarily arcane.

Re:Java 8: No more loops by sswezey on Monday January 12, 2015 @10:45AM (#8874459)
I disagree. The benefit of having the standard terms is they are the same in every FP library you use. If you spend the time to learn and internalize them within one, it'll be the same in every language or library that implements them. I don't understand how map, filter, collect, reduce are obtuse or arcane.
Re:Java 8: No more loops by api on Monday January 12, 2015 @10:47AM (#8874466)
Those aren't the worst offenders. I'm referring to curry, cadr, lambda, monad, etc.

But map is confusing: it's also a data structure. "Wait, does map() create a new key-value dictionary?" Filter and collect are okay. Reduce is pretty arcane but tolerable, but the actual operation feels intuitively closer to "categorize" or "group."

My point about math was cultural. Math seems to revel in having its own peculiar and often even domain specific (even within mathematics!) terms and symbols for things.

Re:Java 8: No more loops by Someone on Monday January 12, 2015 @12:38PM (#8875172)
1. Map isn't "also a data structure", the data structure is a way to implement a mapping function. There is no conceptual difference between code and data (for an example, see http://en.m.wikipedia.org/wiki/Cons#Not_technically_fundamen...)

2. cadr is relatively easy, if you know your assembly (http://en.m.wikipedia.org/wiki/Car_and_cdr#Etymology) :-)

And math has locally defined terms because one cannot give every concept a unique short meaningful memorable name. That is no different in computer science, where 'integer' can include negative numbers or not, may or may not wrap around, can be any number of bits or potentially unlimited, may include minus zero, etc.

Re:Java 8: No more loops by luddypants on Monday January 12, 2015 @01:47PM (#8875638)
>> 2. cadr is relatively easy, if you know your assembly (http://en.m.wikipedia.org/wiki/Car_and_cdr#Etymology) :-)

If you know IBM 704 assembly...

Re:Java 8: No more loops by rosta on Monday January 12, 2015 @11:24AM (#8874721)
reduce (or fold) would be accumulate, certainly not categorize or group.
Re:Java 8: No more loops by kasey_junk on Monday January 12, 2015 @12:57PM (#8875311)
Interesting enough, my academic background was mostly FP based, but my first heavy industry use of the terms was with the LINQ libraries. I have since had lots of experience with the more academic terms and can pretty easily translate back/forth with no problem. Except for filter. I routinely forget if it is "filter in" vs "filter out". It is easy enough to look up, but I never had that problem with LINQ's "where".
Re:Java 8: No more loops by KfZ on Tuesday January 13, 2015 @01:12AM (#8878435)
I'm not sure how those are supposed to be more human-oriented? I'll grant you "where" might be a slight improvement over "filter", but calling "map" "select"? I can't make sense of that even knowing what it's supposed to mean. If anything I'd assume it to be yet another synonym for filter.