Express What, not How.

Raffael Cavallaro raffael at mediaone.net
Sun Oct 19 22:22:04 EDT 2003


Ken Shan <ken at digitas.harvard.edu> wrote in message news:<bmulki$8rg$1 at news.fas.harvard.edu>...

> So according to you, I need to find a name for function
> application, and not just any name -- it needs to be a name from the
> problem domain.

>From the problem domain _at_that_level_. If, at that level, we're
dealing with array bounds checking (assuming, for the moment that
we're using a language that doesn't have that built in), then function
names like check-index, report-invalid-index-error, etc. are names
from the problem domain at that level.

The problem I see with the use of the typical anonymous functional
style is twofold:

1. The same functional idiom is repeated, but not abstracted (i.e.,
not named). This leads to unnecessary "programmer inlining," that is,
writing out the implementation everywhere it is used, rather than
naming it once, and using the name everywhere else.

2. The anonymous functional idioms map well to domains such as
arithmetic, mathematics, and functional programming itself. These same
idioms don't map so well to other domains. The more abstract the
program becomes (that is, the closer it moves to the problem domain,
and the farther it moves from the low level arithmetic and functional
abstractions) the less the anonymous functional idioms will correspond
to the existing concepts and vocabulary of the problem domain.




More information about the Python-list mailing list