r/javascript • • Aug 27 '16

Is your JavaScript function actually pure?

http://staltz.com/is-your-javascript-function-actually-pure.html
8 Upvotes

48 comments sorted by

View all comments

Show parent comments

1

u/Reashu Aug 28 '16

Then arguing about function purity is just... I don't know the English idiom, but it's an unnecessary and uninteresting complication.

1

u/vinnl Aug 28 '16

I suppose that depends on how you learn best. For me, it helps to understand the bigger picture and abstract concepts so I will be able to generalise it to future situations.

1

u/Reashu Aug 28 '16

But purity is not the "big picture" of function contracts. It is a special case, and one of the more thorny ones, to boot.

1

u/vinnl Aug 28 '16

But there is a scale of contracts in terms of how pure your function is, and they're easy to overlook - this article focuses on that bigger picture rather than just passing in undefined. But yes, I consider a look at more extensive typing systems and their encoding of function contracts (i.e. an even bigger picture) to be interesting as well.