Tim Visher <tim.vis...@gmail.com> writes:
> The most annoying thing to me about forward declaration is that it
> prevents what Uncle Bob calls 'Newspaper Style Code' where I can
> structure my code in such a way that the high-level functions are
> right at the top and the primitives that they might need are found
> below so that I or someone else who needs to read me code can stop
> reading at any point and only miss some details about how things work.


I tend to agree with this. I like to write in a relatively literate
style when I can, and group functions according to, er, their function.
Without forward declarations, as Stuart suggests, the primary axis of
classification becomes "primitiveness", which can probably be reduced to
"how many other functions does this one refer to".

> I'm a big fan of this and it's one of the things I miss most about
> other languages when I'm in Clojure. Keepin a bunch of primitives in
> my head without seeing the big picture so that when I see the big
> picture it makes more sense is difficult and for whatever reason
> scrolling from the bottom of the file feels unnatrural enough that I
> still haven't gotten used to it.
>
> One advantage though is that the requiring forward declaration does
> gaurentee that if it compiles the code will not have a mixture of the
> two styles.


True. And it also stops the spell mistake errors that I am used to in
Elisp where you call a function by the wrong name. Although, then
clojure brings the problems of accidentally capturing a clojure core
name:

(defn thing [class]
    (do-other-thing name))

which compiles just fine but is going to do the wrong thing.

Compromises, compromises.

Phil

-- 
-- 
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
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to