Recently at my company we've had a bit of a debate about abstraction vs. simplicity. One school of thought I'd characterize as "DRY and abstraction can do no harm," and leads to code like this:
def make_foo_binary(binaryName, objFiles, fooLibsToLinkAgainst) make_exe_task(binaryName, objFiles.ext('.o'), fooLibsToLinkAgainst) end
class String def escape_space return self.gsub(' ', '\ ') end end
My point of view is that creating an abstraction like this, that's only used in one place, makes the code less readable, since you're replacing a function call that the reader is familiar with (gsub) with another that they've never seen before (escape_space), which they'll need to read if they want to understand how the code actually works. The replacement is essentially described in English ("escape space") and english is notoriously vague. For example, without looking at the definition, you don't know whether it escapes all whitespace, or just the space character.
There's lots of writing that sings the praises of DRY and abstraction. Is anybody aware of sources that describe abstraction's limits? That sing the praises and discuss the pragmatics of keeping code simple?
Edit: I can find texts that encourage simplicity in life or in (English) writing, e.g. Thoreau's "Simplify, Simplify!" or Strunk and White's "Vigorous writing is concise." Where's the equivalent for programming?