This is an unfinished thought: I think that the Single-Level-of-
Abstraction (SLA) principle promoted in OO needs to have a prominent
place in functional programming, too!

Each function should talk about the problem in its level of
abstraction, e.g. in its language. Functions related to the same level
of abstraction can be put into a package.

The problem of course is to understand what a level of abstraction is.
Therefore this thought is yet unfinished. Just a parallel I came
across some time ago. I prefer designing software along "features". A
lot of people have different ideas of what a feature is. I came across
a good way to identify features in the already mentioned book "Java
Modeling in Color with UML". They use a language template "<action>
the <result> <by|for|of|to> a(n) <object>" e.g. "Calculate the total
of a sale" or "Calculate the total purchases by a customer". The key
here was to find a language template. Language is at the core of this
concept. I feel that language may be also the core to find out a level
of abstraction.

A rule of thumb for me was in the past to look for groups of functions
that I start to add a name prefix to, e.g. "excel-number-cell", "excel-
format", ... I put them in a package"...excel". In general I am very
reluctant to creating namespaces. I often feel that name spaces are as
much in my way to create software as static type systems are. A
certain fraction of my brain is constantly involved in thinking about
"which grouping should I use" instead of thinking about the problem
and the level of abstraction at hand. By the way a similar experience
is between using C++ and using a language with a garbage collection. A
fraction of your brain is constantly busy with thinking about memory
allocation (extremely low level of abstraction) instead of the level
of abstraction you should think about.

Perhaps somebody else has already thought further into that direction
and I would be happy to take over your learnings :)

-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

Reply via email to