Live data from Hacker News

Metaphors we learn to program by

evanlh.com

11–15 of 15 posts

Re: Metaphors we learn to program by

#11
post #8

Hard disagree that most of these are metaphors in actual use. They’re more like mnemonics, arbitrary names for highly abstract concepts that are only incidentally borrowed from ordinary languages. For example, I never think of a physical dictionary when using the data structure. Much less a heap or a tree (we even draw those with the root at the top!). And the stuff in the article about database queries being “suppli…

And yet... in a mysterious and unfathomable coincidence, one of the biggest corporate DB companies is literally called Oracle.

That's the point about Lakoff's metaphors. We use them without being aware of them. And yes - there's a social and political element as well as a (pseudo)tangible one.

Although in this case I'd suggest they're more like analogies. If you had never seen a physical wall of storage boxes - in photos or the movies is fine, you don't need a direct personal experience - wouldn't it be harder to imagine what a key/value store is?

You may think you'd just know. But would you?

Most people find programming hard because they don't have these metaphors to (metaphorical) hand. You need a certain mindset which understands representations, relationships, and transformations in a certain kind of way.

People who have this find the basics "obvious" and can usually be trained to work their way up to more complex abstractions.

People who don't can't do it at all.

Re: Metaphors we learn to program by

#12

Neat, I skimmed through "metaphors we live by" a few weeks ago and can't stop applying it everywhere. I recently wrote a post that's kind of on "GOOD CODE IS CLEAN" [1]. I can't recall how dependent I was on physical metaphors when I was first learning to code. I do, however, remember some times that I tried to learn concepts and a spatial metaphor set me back significantly. Like "railway-oriented" for async error ha…

Great feedback re the risks of physical metaphors! I'd agree a bad one does more harm than good. Lakoff points out that our linguistic conceptions typically compose-- so you can talk about both IDEAS as BUILDINGS and as CONTAINERS because the former is a special case of the latter-- and we lose that quickly when mapping to programming. I'm not sure if that's inherent in how abstract these things are or if it just hasn't been attempted on a deep enough level. (Do other control structures fit into the railway paradigm? Is it generative?)

Enjoyed your post, lots to unpack in the 'cleanliness' analogy, will think on it.

Re: Metaphors we learn to program by

#14
post #7

I don't buy Lakoff's idea that meaning is fundamentally metaphorical. For one thing, it fails to account for our ability to judge the aptness of a given metaphor. There's a book, Understanding Figurative Language, that makes a critique along these lines.

Conceptual metaphor is different from literary metaphor. It's one of the first things Lakoff talks about.

Re: Metaphors we learn to program by

#15
post #7

I don't buy Lakoff's idea that meaning is fundamentally metaphorical. For one thing, it fails to account for our ability to judge the aptness of a given metaphor. There's a book, Understanding Figurative Language, that makes a critique along these lines.

Conceptual metaphor is different from literary metaphor. It's one of the first things Lakoff talks about.

[deleted]
Post reply on HN