I agree, this approach fits with our code base.

Apply induces a significant hit and should be avoided when performance is
critical. I tend to let the computer do its job and free my brain estate for 
more
useful things until performance becomes critical. A kind of laziness :))

Luc P.


> My rule of thumb for this is if that's something that will be "static" (as 
> in, set once in the source and never changes) kw options are fine, if it is 
> likely to be manipulated, is the result of some previous computation, then 
> a map fits better. 
> 
> apply also has a performance cost that's not always welcome.
> 
> On Tuesday, June 18, 2013 3:38:55 PM UTC+2, Luc wrote:
> >
> > I use destructuring most of the time, the main benefits I see are runtime 
> > validation 
> > of typo errors in the option names, better doc strings and the ability to 
> > provide defaults 
> > where nil does not make any sense. 
> >
> > Of course you may need to use apply to pass options in turn to another fn 
> > but I found out that this happens most of the time internally, not in the 
> > public API. 
> >
> > Sub-selecting options with select-key makes things easier to read when 
> > pruning 
> > options used by internal fns. 
> >
> > Marginally slower but less brain estate is required to remember valid 
> > options. 
> >
> > If the apply stuff gets repeatedly in the way, then use a macro to hide 
> > it. 
> >
> > Luc P. 
> >
> >
> >
> > -- 
> > Softaddicts<lprefo...@softaddicts.ca <javascript:>> sent by ibisMail from 
> > my ipad! 
> >
> 
> -- 
> -- 
> 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.
> 
> 
> 
--
Softaddicts<lprefonta...@softaddicts.ca> sent by ibisMail from my ipad!

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