On 19/09/2014 16:46, Lee Spector wrote:
On Sep 19, 2014, at 11:26 AM, John Gabriele <jmg3...@gmail.com> wrote:
Don't use `use`. :)
Since the OP is new here I'll point out that that ":)" is probably a nod to the fact that
there's a long history of controversy on the utility/evils of "use". Some (like me) think
there are programming contexts in which it is appropriate and importantly helpful. Others think it
should be abolished. A lot more discussion can be found in the archives if you're really interested.
In short: use 'use' in the repl or any time you're generally feeling
lazy. Don't use it in non-throwaway code.
Use automatically refers *everything* in a namespace. This is handy if
you don't want to type out the names, but it creates two few problems:
1. It increases the chances of a conflict when the same name appears in
more than one namespace.
2. As an extension to (1) it creates forward compatibility problems,
where the namespaces you are importing change; so on day one your code
works fine, but on day 2 it doesn't, because someone (possibly outside
your control) added a new item to one of the namespaces you are
importing with use, that now conflicts with one of the others.
3. It makes your code less readable, because if you use some "foo", then
anyone that isn't familiar with "foo" won't know which namespace you
imported it from (or might think it came from a different namespace than
it actually did). When you explicitly refer each "foo", "bar", etc.,
it's easy to see where they came from (by reading *just* your code and
without having to go searching around in other files).
- Robert
--
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/d/optout.