tungwaiyip.info

home

about me

links

Blog

< July 2021 >
SuMoTuWeThFrSa
     1 2 3
4 5 6 7 8 910
11121314151617
18192021222324
25262728293031

past articles »

Click for San Francisco, California Forecast

San Francisco, USA

 

Metaphor in Computer Science

I have enjoyed Lakoff and Johnson's classic book Metaphors We Live By. Originally published in 1980, they argue that metaphor is not simply a literary device. Instead it is a fundamental way the human mind makes sense of the world, by using knowledge in one domain to reason about another domain. The use of metaphor is pervasive in our throught, whether we are aware of it or not.

Once I learned how to look, I started to see our use of metaphor everywhere. For example, we describe a computer program execution (a job) as a life object.

  • The job is created
  • The job uses a lot of memory
  • Is it still alive?
  • It is frozen
  • Kill the job

A faulty computer program is said to have a bug. A job as a programmer is to find bugs and remove bugs from software.

Data Structures are often conceived metaphorically. We have data structures like stacks (e.g. a stack of paper), queues, trees, and dictionaries, etc. Tree is a special metaphor. It is structurally similar to a biological tree. It has many branches and each branch has more sub-branches. On the other hand, we don't use other parts of the metaphor such as that tree is a living object that breathes and requires nutrition. Instead, all these data structures use the container metaphor. We put things into them and we take things out.

Computer science is often abstract in nature. We map abstract ideas into familiar concepts using metaphors. The mechanics of a "pointer" is a number used as the memory address of another data of interest. Instead of thinking about the mechanics, we conceive the pointer as an arrow that points to the referenced item. The pointer metaphor makes this much easier to make sense of.

2021.07.24 comments

 

 

blog comments powered by Disqus

past articles »

 

BBC News

 

Xi defends Hong Kong rule on handover anniversary (01 Jul 2022)

 

Hong Kong handover: What will the next 25 years hold? (01 Jul 2022)

 

Ukraine war: Russian missile strikes kill 18 in Odesa region - emergency service (01 Jul 2022)

 

Missing Cryptoqueen: FBI adds Ruja Ignatova to top ten most wanted (01 Jul 2022)

 

Nupur Sharma: India court says Prophet row 'set country on fire' (01 Jul 2022)

 

Bison attacks woman at Yellowstone National Park (01 Jul 2022)

 

Technoblade: Minecraft YouTuber dies from cancer aged 23 (01 Jul 2022)

 

Supreme Court limits Biden's power to cut emissions (30 Jun 2022)

 

Nato Summit: Did Justin Trudeau forget Australian PM’s name? (01 Jul 2022)

 

North Korea claims Covid arrived on 'alien things' near border (01 Jul 2022)

more »

 

SF Gate

 

'This will be somewhat painful': Elon Musk talks Twitter takeover in extended interview at TED2022 Vancouver (14 Apr 2022)

 

Best Background Check Services in 2022, Top 13 People Finder Sites Reviewed (5 Apr 2022)

 

Better.com employees got severance checks before they were laid off (9 Mar 2022)

 

Apple joins other Bay Area tech giants in responding to Russian invasion of Ukraine (1 Mar 2022)

 

Uber will now show you how you’re rated by drivers (18 Feb 2022)

 

The man behind Google’s Silicon Valley headquarters says fancy tech offices are ‘dangerous’ (24 Jan 2022)

more »


Site feed Updated: 2022-Jul-01 03:00