Wednesday, November 16, 2005

What's it all about?

In The Society of The Mind (21.1 The Pronouns Of The Mind), Marvin Minsky said:

"We often say what we want to say in fewer words than might seem possible." (Unless we are coding COBOL, of course :) "Many people consider a pronoun like 'it' to be an abbreviation or substitute for another phrase used recently [...] In other words, pronouns do not signify objects or words; instead, they represent conceptions, ideas or activities that the speaker assumes are going on inside the listener's mind."

Imagine if we could assume something was going on in the mind of a programmer, and so could use "it" in a magical language. To what would "it" point if I were to write


def findSong(pathToAlbum,track):
for each song in the album:
if it is that track:
return it
return None

?

We would not even need to assume a programmer's mind as long as he has left sufficient previous definitions for context (e.g. song, album). If he has not left enough previous definitions, e.g.

return it

then we must assume the programmer has a meaning for it in this context. If we assume the programmer knows python, we could even parse this it as 0, by analogy with the perfect program. It becomes less easy to parse the further the writer gets from being a good programmer:


'''if the program exists, send the 0 again'''
if this:
return that

'''loop to the start of the program'''
take it from the top

'''dump core'''
give it to me

0 Comments:

Post a Comment

<< Home