On Tuesday, 23 July 2013 16:50:50 UTC+1, Greg Slepak wrote:

> I think I read somewhere that :use is no longer encouraged, but I could be 
> mistaken. 
>
> From what I've read, it seems like most people agree that Clojure has too 
> many ways of including/importing/referencing/requiring/using things: 
>
>
> http://blog.8thlight.com/colin-jones/2010/12/05/clojure-libs-and-namespaces-require-use-import-and-ns.html
>  
>
> The above gives a very nice explanation of all the various difference, but 
> it also acknowledges their complexity. 
>
> Since :use uses :require, and since :require can do everything that :use 
> can, can we simplify Clojure programming a bit for newcomers by deprecating 
> the use of :use? The situation in ClojureScript is even worse because it 
> adds :require-macros on top of all the other ways of including files. 
>
> Ideally, it would be awesome if there was just a single directive for 
> everything, but perhaps there's some complicated low-level reason why 
> that's not possible. :-\ 
>
> Thoughts? 
>
> Thanks, 
> Greg 
>

I don't think :use should be deprecated. Reasons:
- It's already out there in a lot of production code (most important 
reason!)
- It's a convenient feature: it saves typing out :require [.... :refer 
:all]. Not that this matters much in ns declarations, but it would annoy me 
when :use was perfectly functional for this case.
- It's consistent with "use", which is a very helpful short command for 
setting up a REPL session quickly. And saving typing definitely *does* 
matter in REPL sessions.
- There's no technical/logical problem with it (it's just a simple 
composition of require + refer)
- I personally find it a helpful pattern : often I want an entire namespace 
available, and I don't want to be manually requiring specific functions 
every time I need something new from the namespace. That's just pointless 
boilerplate to maintain.

I guess removing it would be a slight simplification to the 
already-complicated ns syntax, but to me that is vastly outweighed by the 
above.

If people want to write code-style tools that auto-convert :use into 
equivalent :require clauses then that is obviously fine. I wouldn't use 
such tools myself, but I'm all for people having flexibility to determine 
their own coding style.

But let's not get into the habit of making breaking changes that remove 
useful features without very good reasons.
 

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