Exactly, I was quite confused at the title, and sort of hate this idea’s
name because it’s so easy to confuse. I often like to think of it as being
“Aggressive” or “Passive” – Aggressive code instructs other code to do
things, and expects results. Passive code makes a bunch of little requests
and tries to do it all itself.
Another metaphor is delegation vs. micromanagement, which I think
highlights the reason why it’s a good idea very clearly. Just as a good
manager delegates responsibility to relatively autonomous employee’s, so
your code should delegate tasks to relatively autonomous objects.
Similarly, a bad manager meticulously details every element of his
employee’s work, resulting generally in inefficiency, frustration, and
codependency (which we might call “tight-coupling”)
I read this, not sure what to expect; after the first paragraph, I assumed I would see an enlightening way to do declarative programming in ruby sadly, I didn’t. The “ask” in this case, is still highly imperative, just slightly less so. It’s certainly less “tell” than the examples it’s compared against but I was left disappointed. I was expecting something more interesting.
It’s a nice article, but deeply confused about terminology. Don’t miss the link at the end to Dave Thomas’s response.
It’s using tell and ask in a very different way than what I am used to with:
“Tell Don’t Ask” -> http://c2.com/cgi/wiki?TellDontAsk
Exactly, I was quite confused at the title, and sort of hate this idea’s name because it’s so easy to confuse. I often like to think of it as being “Aggressive” or “Passive” – Aggressive code instructs other code to do things, and expects results. Passive code makes a bunch of little requests and tries to do it all itself.
Another metaphor is delegation vs. micromanagement, which I think highlights the reason why it’s a good idea very clearly. Just as a good manager delegates responsibility to relatively autonomous employee’s, so your code should delegate tasks to relatively autonomous objects. Similarly, a bad manager meticulously details every element of his employee’s work, resulting generally in inefficiency, frustration, and codependency (which we might call “tight-coupling”)
I read this, not sure what to expect; after the first paragraph, I assumed I would see an enlightening way to do declarative programming in ruby sadly, I didn’t. The “ask” in this case, is still highly imperative, just slightly less so. It’s certainly less “tell” than the examples it’s compared against but I was left disappointed. I was expecting something more interesting.