JavaScript Functional Programming — map, filter and reduce

map is used when you have an array of stuff ( scientific term ) and you want todo something ( another scientific term ) for every item in that array.

The filter() method creates a new array with all elements that pass the test implemented by the provided function.

The reduce() method applies a function against an accumulator and each element in the array (from left to right) to reduce it to a single value.

The Bipolar Lisp Programmer

Now one of the things about Lisp, and I’ve seen it before, is that Lisp is a real magnet for this kind of mind.   Once you understand that, and see that it is this kind of mind that has contributed a lot to the culture of Lisp, you begin to see why Lisp is, like many of its proponents, a brilliant failure.  It shares the peculiar strengths and weaknesses of the brilliant bipolar mind (BBM).

.. Because Lisp, as a tool, is to the mind as the lever is to the arm.  It amplifies your power and enables you to embark on projects beyond the scope of lesser languages like C.   Writing in C is like building a mosaic out of lentils using a tweezer and glue.   Lisp is like wielding an air gun with power and precision.   It opens out whole kingdoms shut to other programmers.

.. so we have a long list of ideas that originated with Lispers – garbage collection, list handling, personal computing, windowing and areas in which Lisp people were amongst the earliest pioneers.  So we would think, off the cuff, that Lisp should be well established, the premiere programming language because hey – its great and we were the first guys to do this stuff.

But it isn’t and the reasons why not are not in the language, but in the community itself, which contains not just the strengths but also the weaknesses of the BBM.

.. One of these is the inability to finish things off properly.

Python Coconut

Coconut is a simple, elegant, Pythonic functional programming language that compiles to Python. Since all valid Python is valid Coconut, joining the over 30,000 people already using Coconut will only extend and enhance what you’re already capable of in Python.

.. Coconut does to functional programming what Python did to imperative programming. And Coconut code runs the same on any Python version