Hacker News new | ask | show | jobs
by wrs 1992 days ago
The class name “Map” is a noun (because it’s a class), the method name “map” is a verb (because it’s a method), and the conceptual relationship between that noun and verb is exactly the conceptual relationship between the class and the method. There’s nothing “unfortunate” about it at all. It’s elegant, in fact. (And if you know some math, it’s even familiar.)
1 comments

The fact that the Map class doesn't have a map() method, is however extremely unfortunate. The number of times I've been backed into a corner where I have to convert a Map to an Array of (key, value) pairs, just so that some other API could map() over it's contents...