Hacker News new | past | comments | ask | show | jobs | submit login
[flagged]
tderflinger 3 months ago | hide | past | favorite



This blog post feels like the couple 1000 others or so medium posts we've seen in the past few years mostly around Array functions from web developers trying to boost their socials.

I likely wouldn't have pointed this out if OP wouldn't have used HN so far as a link directory.


> functions generally and especially pure functions are easier to reason about than the object-oriented programming (OOP) paradigm.

...goes on to list a whole bunch of object-oriented functions. And, under "Array", specifically points out:

> These array functions do not modify the original array, but return a new array or a value based on the input array.

Yes. As the article repeatedly demonstrates, but... seemingly fails to understand?... OOP and pure functional programming are not mutually exclusive!

Edit: Also, just realised that the article has weirdly missed String.length() and Array.length() as not mutating their implicit `this` parameter?


An implicit assumption is the prototypes of input objects have not been altered to add side effects.


Functional programming style in JavaScript has become more popular in recent years. Therefore, it is important to know examples of pure functions that are available to all JavaScript developers. They are the preferred way to use functional programming in JavaScript.




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

Search: