Hacker News new | ask | show | jobs
by markmark 5653 days ago
>But the first makes my intent clearer than the second

That is entirely a matter of opinion. I would say python programmers with no functional background would find the list comprehension clearer, because that is the idiomatic python way.

May would have no idea what map even does without looking it up on the net.

1 comments

> That is entirely a matter of opinion.

It isn't entirely a matter of opinion, is it? When you use map to do your mapping, aren't you are stating your intent in the language of the profession? The name of the function, after all, is "map," and isn't this term's meaning rather firmly established in mathematics and computer science? So, the idea of calling a map a map has some precedent that we can use to justify the practice, doesn't it?

Now, if your audience has no notion of what a mapping is, then, yes, there's a level of semantic intent that you're not going to be able to communicate to them. (At least until they learn the concept; it's common, worth learning, and not hard to grasp.) But that doesn't mean that you should refuse to call an important concept by its established name.

Concepts, after all, earn their names for a reason. If a concept has one, it's probably best to use it.