Martin,

It's very simple, I like it.

There two things that stand out to me, both having to do with
readabiliby.

Instead of using (def score) you should use (declare score). declare
exists for the purpose of making forward declarations. That one is
black and white. You have to do it.

The other I am not so sure about. You create a function named sum
which calls (reduce + rolls). I think that an experienced Clojure
programmer would rather just see
(reduce + (take 2 rolls)) rather than (sum (take 2 rolls)). There are
two reasons you may want to create the sum function. One bad and one
not so bad. The first is that you think reduce + is confusing and so
you are creating a name that makes more sense to you. The second is
that you are going to be using it a lot and you want to save 5
keystrokes. I have issue with the first reason. When an experienced
Clojure dev sees (reduce + (take 2 rolls)) there is only one foreign
idea to think about, namely rolls. When they see (sum (take 2 rolls))
the complexity has increased because they now they have two foreign
ideas to think about. Another way to think about it is that when I see
(reduce + (take 2 rolls)) I know exactly what it does. When I see (sum
(take 2 rolls)), I don't know what it does. sum could be some crazy,
messed up side effecting function that could cause all kinds of
problems. In your code it is easy to check that sum is correct but
what if it was implemented in another file?

I only point this out because I find myself doing this all the time.

Brenton

On Feb 11, 9:19 am, Martin Hauner <martin.hau...@gmx.net> wrote:
> Hi,
>
> I'm doing my first steps in Clojure and I would like to get some
> feedback on my implementation of the Bowling Game Kata. The code is
> herehttp://softnoise.wordpress.com/2010/02/07/the-bowling-kata-in-clojure.
> I can post the code here if that's preferred.
>
> I'm mostly interested if there is anything in my code one would/should
> never do that way.
>
> Thanks
>   Martin

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