Hacker News new | ask | show | jobs
by the_af 2157 days ago
But Math is taught gradually, introducing concepts in child-friendly ways, and moving up towards "adult" notation.

Note that if you programmed in FP languages, you'd have to unlearn the "descriptive variable names" thing you were taught. Once you deal with abstractions, names cease to be meaningful. 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. Some very good programmers argue that long/descriptive names often obscure the shape of an abstraction.

1 comments

> 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.

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.