4 ms·
It really is an excellent introduction to FP, but: > I know python quite well, but I did not understand functional programming before I read this article Sou
by bufordsharkley 12y ago
It really is an excellent introduction to FP, but:
> I know python quite well, but I did not understand functional programming before I read this article
Sounds like someone who would have benefitted from practical uses of FP in python, such as comprehensions.
...It's a really neat article, but I think it would have been considerably improved with asides for "And here's an even cleaner way to write this, if you're using python"
- jgable 12y agoI do know list comprehensions, and I use them all the time (not trying to be defensive here, just providing context). I understand that they are just a different syntax for mapping -- applying a function to members of a list to produce a new list. However, while list comprehensions are clean and pythonic syntax, I think the "map" syntax more clearly illustrates the concept that the author is trying to teach. Your suggestion for asides is certainly valid, and I agree would make it more useful for budding pythonistas. I just think that her focus was to introduce functional concepts, and python was simply an easy language to make the concepts concrete. I think that it's stretching the scope of the article, and therefore watering down its message, to put any additional focus on specific features of the python language. I guess this is an example of my earlier point: I knew about map and reduce, and understood their power. However, it had not clicked for me before reading this article that they feature so prominently in functional programming because they work with functions that have no side effects.