On Tue, Nov 19, 2013 at 11:44 AM, John D. Hume <duelin.mark...@gmail.com>wrote:

> After some experience with excessively meta-programmed Ruby apps, I
> generally try to design an API that is as clean (or almost) as what I'm
> tempted to generate and avoid the metaprogramming. For example
> (api/get-user-by-id "123") is only slightly nicer than (api/get-by-id
> :user "123"), so if the former requires code that some of the team will be
> afraid to touch, or requires an extra build step, I prefer the latter.
>
> Maybe if you spell out some of the boiler-plate you want to eliminate
> we'll have a better idea of what you're trying to achieve.
>

One specific example is my App.net library:

https://github.com/literally/paprika/blob/0be6da626258ca1336224310a0413d15b64c20c1/src/paprika/core.clj#L56

As you see, there is a function for every endpoint that delegates to a
single function call that handles most of the cases rather
straightforwardly. This however feels like a maintenance nightmare. If for
some reason the common function requires a significant change, then
everything will be affected. Whereas if the functions were generated at
compile time, then the changes would "propagate" by design.

This may not be a real problem, though. I just feel like the super
repetitive nature of this code is a smell, but I'm not entirely sure.

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