Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Yes. The map method is not functional in the sense that the map function is functional. In actual code, I'd use the method too.


I don't really see the method as being any less functional than the function version (ie, they're both without side effects, the method version just has 'this' as an implicit parameter).

Though I guess that's just a difference in perspective.

Edit: Having stumbled upon something else you wrote[1](Viz. "WHy the crazy idea of using a splatter instead of a mapping method or function?"), I now understand the reason you're making the distinction. Though (speaking as someone who certainly doesn't have the level of expertise to be making this semantic argument) I really don't think it's the distinction between "functional" and "not functional" so much as... "composability"?

[1] https://github.com/raganwald/homoiconic/blob/master/2013/01/...


I think a lot of people would argue that composability is what "functional" code is really interested and many of the other things that are normally associated with it are actually side-effects of the emphasis on composition.


Exactly. There's no point being "functional" for the sake of functions. It's for the benefits this style brings, an important one being composability.




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

Search: