Hacker News new | ask | show | jobs
by zamfi 2157 days ago
> If the most you can say about a parameter to a higher order function is that it is "a function", then "f" is the best name for it

Of course. But even in FP languages you don’t name all your functions “f”! At some level of abstraction, sure, you use “i” for index variables, etc., but once you back out of that low level, you are going to be naming things that are less abstract.

1 comments

Agreed. I'd say Math is a lot like the abstract parts of FP, and so short variable names make sense there, just like they do in higher order FP functions. Choosing "more descriptive" names risks locking you into a specific metaphor and prevents you from seeing the big picture, which seems doubly dangerous in Math.