I'm not sure why the team used single-letter names
I find myself doing this quite a bit. I think the reason is that it's so pervasive in the core.clj code. Take the documentation for update-in below:
(update-in m [k & ks] f & args)
'Updates' a value in a nested associative structure, where ks is a
sequence of keys and f is a function that will take the old value
and any supplied args and return the new value, and returns a new
nested structure. If any levels do not exist, hash-maps will be
created.
After having looked at a lot of clojure doc, those single letter names make sense to me (k = key, ks = keys, f = function). I use the same style when writing "core-like" functions, but anything remotely application specific is descriptively named.
That makes sense. I was under the impression that they were using it for their program-specific items. Using single letters for common things like k, v, f, args, etc seem more "universal" to other languages than using (defn f [a b c d e] ...).
Of course, he didn't show us any of the funky code he was talking about, but I get this impression from the line about using single letter names instead of highly descriptive names.
I should also take the time to look at the Clojure Core one day. Thanks for reminding me to put that on my to-do list.
Clojure Corey's worth reading, but know that it is considered to be extremely non-idiomatic. Several reasons:
1. Bootstrapping. Some functions are defined somewhat verbosely because the higher order functions are defined later.
2. Performance. By definition, everyone uses core, so core is on everyone's critical path. Therefore, core must sacrifice idiomatic code and brevity for performance. You should make the same tradeoffs only after measuring.
3. Evolution. Clojure has gained features and, since stability is valued, core doesn't get revamped to utilize them without greater justification.
I find myself doing this quite a bit. I think the reason is that it's so pervasive in the core.clj code. Take the documentation for update-in below:
After having looked at a lot of clojure doc, those single letter names make sense to me (k = key, ks = keys, f = function). I use the same style when writing "core-like" functions, but anything remotely application specific is descriptively named.