On Fri, Jan 2, 2009 at 4:23 PM, Christian Vest Hansen
<karmazi...@gmail.com> wrote:
>
> What is it that makes this code "literate"?

Perhaps my understanding of the term is a bit off. What makes this
code different from most Clojure code I see is that the functions tend
to be very short and focused. I think this makes reading the code much
easier. I don't feel like I have to think as hard to figure out what
each piece is doing. This makes me more comfortable with including
almost no comments. For example, my previous version contained this:

(paintComponent [graphics]
      (proxy-super paintComponent graphics)
      (paint graphics @apple (colors :apple))
      (doseq [point (:body @snake)]
        (paint graphics point (colors :snake))))

My new version contains this:

    (paintComponent [graphics]
      (proxy-super paintComponent graphics)
      (paint-apple graphics)
      (paint-snake graphics))

This is a style that is strongly encouraged in Smalltalk, and perhaps
in many other programming communities. It's really just lots of
application of the "extract method" refactoring pattern.

-- 
R. Mark Volkmann
Object Computing, Inc.

--~--~---------~--~----~------------~-------~--~----~
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
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