Cope,I think about it exactly like this, right down to the connection with short term memory. I still don't see a problem with little pieces down at the bottom, as long as each level of the hierarchy doesn't get exploded too far.As an anology:A brick house with 5 rooms.Each room with 4 (or so) walls.Each wall is divided into "panels" of brick (I admit the analogy is slightly strained here, but the idea should be clear).Each panel is made up of individual bricks.At each stage of the zoom process, the total number of elements is small enough to be held by the mind. And yet the house itself is made up of little bricks.
On Wednesday, April 23, 2014 3:54:03 PM UTC-5, Cope wrote:
Den 23/04/2014 kl. 22.47 skrev Raoul Duke <rao...@gmail.com>:
> i believe
> there can be smaller things and yet still have a good architecture.
Architects (like Alexander) talk about two things with regard to size. One is to build at human scale: things should be humanly comprehensible. The other is levels of scale: no thing should be broken down more than a factor of two or three from its supertending structure. If you break down a meaningful 100-line algorithm into 3-line fragments, you violate the human mind's ability to reason about enough things simultaneously to be able to make sense of them. Short term memory can keep about five things — seven at the most, more or less — in short-term memory to be able to reason about them together. Breaking down a gestalt into more than seven things doesn't work. That translates into lines of code, and supports my argument.
Of course, experience and common sense do, too....
So I guess I disagree.
--
You received this message because you are subscribed to the Google Groups "object-composition" group.
To unsubscribe from this group and stop receiving emails from it, send an email to object-composit...@googlegroups.com.
To post to this group, send email to object-co...@googlegroups.com.
Visit this group at http://groups.google.com/group/object-composition.
For more options, visit https://groups.google.com/d/optout.
--
That was not the question :)
MvhRune
--Well the little bricks are essentially implementation details of the panel in this analogy, so the panel is responsible for ensuring its own integrity should it decide to replace one or more of its bricks. The wall, in turn, relies only on the promise that the panel has X load bearing capacity, Y shear stress capacity, and so on.
On Thursday, April 24, 2014 4:24:07 AM UTC-5, Rune wrote:So you understand what the construction is if you see the whole but can you understand the function of the individual pieces when you can't see the hole? Eg by looking at a panel do you know whether it's safe to remove it or that the house would collapse because it's part of the support structure?
You received this message because you are subscribed to the Google Groups "object-composition" group.
To unsubscribe from this group and stop receiving emails from it, send an email to object-composition+unsub...@googlegroups.com.
Fair enough but the answer is the same, mine was just one level further down the hierarchy :)You asked: By looking at the panel, how do you know if it's safe to remove it? The "Wall" is responsible for its panels. The "Room" relies on the promise of each Wall, that is has X load bearing strength, and so on. It doesn't care about how each wall achieves that. The "Wall" knows how many panels it needs, and of what kind, to live up to that promise. So you cannot know by looking at a panel if it's safe to remove, but you can know by looking at its containing wall.
--
On Thursday, April 24, 2014 5:54:17 AM UTC-5, Rune wrote:That was not the question :)
MvhRune--Well the little bricks are essentially implementation details of the panel in this analogy, so the panel is responsible for ensuring its own integrity should it decide to replace one or more of its bricks. The wall, in turn, relies only on the promise that the panel has X load bearing capacity, Y shear stress capacity, and so on.
On Thursday, April 24, 2014 4:24:07 AM UTC-5, Rune wrote:So you understand what the construction is if you see the whole but can you understand the function of the individual pieces when you can't see the hole? Eg by looking at a panel do you know whether it's safe to remove it or that the house would collapse because it's part of the support structure?
You received this message because you are subscribed to the Google Groups "object-composition" group.
To unsubscribe from this group and stop receiving emails from it, send an email to object-composition+unsub...@googlegroups.com.
To post to this group, send email to object-co...@googlegroups.com.
Visit this group at http://groups.google.com/group/object-composition.
For more options, visit https://groups.google.com/d/optout.
You received this message because you are subscribed to the Google Groups "object-composition" group.
To unsubscribe from this group and stop receiving emails from it, send an email to object-composit...@googlegroups.com.
To post to this group, send email to object-co...@googlegroups.com.
Visit this group at http://groups.google.com/group/object-composition.
For more options, visit https://groups.google.com/d/optout.
Fair enough but the answer is the same, mine was just one level further down the hierarchy :)
You asked: By looking at the panel, how do you know if it's safe to remove it? The "Wall" is responsible for its panels. The "Room" relies on the promise of each Wall, that is has X load bearing strength, and so on. It doesn't care about how each wall achieves that. The "Wall" knows how many panels it needs, and of what kind, to live up to that promise. So you cannot know by looking at a panel if it's safe to remove, but you can know by looking at its containing wall.
On Thursday, April 24, 2014 5:54:17 AM UTC-5, Rune wrote:
That was not the question :)
MvhRune
--Well the little bricks are essentially implementation details of the panel in this analogy, so the panel is responsible for ensuring its own integrity should it decide to replace one or more of its bricks. The wall, in turn, relies only on the promise that the panel has X load bearing capacity, Y shear stress capacity, and so on.
On Thursday, April 24, 2014 4:24:07 AM UTC-5, Rune wrote:So you understand what the construction is if you see the whole but can you understand the function of the individual pieces when you can't see the hole? Eg by looking at a panel do you know whether it's safe to remove it or that the house would collapse because it's part of the support structure?
You received this message because you are subscribed to the Google Groups "object-composition" group.
To unsubscribe from this group and stop receiving emails from it, send an email to object-composit...@googlegroups.com.
To post to this group, send email to object-co...@googlegroups.com.
Visit this group at http://groups.google.com/group/object-composition.
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google Groups "object-composition" group.
To unsubscribe from this group and stop receiving emails from it, send an email to object-composit...@googlegroups.com.
At each stage of the zoom process, the total number of elements is small enough to be held by the mind. And yet the house itself is made up of little bricks.
Well the little bricks are essentially implementation details of the panel in this analogy, so the panel is responsible for ensuring its own integrity should it decide to replace one or more of its bricks.
The wall has a certain contract that it can support X weight, etc.
So clearly my hastily chosen metaphor was a poor one. But I can't tell if your critique is meant to apply only to my metaphor or to the actual point I was trying to make? If the latter, are you saying that some functions/methods should never be further subdivided, even if they 200 lines long, because they map to something in our mental model which we don't naturally subdivide conceptually? What if the methods we break them down with are private and used just to make the code more readable? I'm sort of guessing now what you meant.... Honestly I'm confused what the discussion is about anymore we've gotten so deep in metaphor land -- my fault for starting it :)
but i don't believe even 10% of all software would fall into that
trap. 90% of all software is such bloated crap that there's a zillion
person-hours of breaking things down that can happen before it gets to
the breaking point.
which bring me back to that request for a concrete example :)
> i believe
> there can be smaller things and yet still have a good architecture.
Architects (like Alexander) talk about two things with regard to size. One is to build at human scale: things should be humanly comprehensible. The other is levels of scale: no thing should be broken down more than a factor of two or three from its supertending structure. If you break down a meaningful 100-line algorithm into 3-line fragments, you violate the human mind's ability to reason about enough things simultaneously to be able to make sense of them. Short term memory can keep about five things -- seven at the most, more or less -- in short-term memory to be able to reason about them together. Breaking down a gestalt into more than seven things doesn't work. That translates into lines of code, and supports my argument.
Of course, experience and common sense do, too....
So I guess I disagree.
grammar.y c confirms my experience: Long methods tend to list a number of trivial, but related details. The structure was always simple.
--
You received this message because you are subscribed to the Google Groups "object-composition" group.
To unsubscribe from this group and stop receiving emails from it, send an email to object-composit...@googlegroups.com.
To post to this group, send email to object-co...@googlegroups.com.
Visit this group at http://groups.google.com/group/object-composition.
For more options, visit https://groups.google.com/d/optout.
--
Where is the 50 lines long method in here? The longest is `endedge` and it's around 30 lines.
Your grammar.y example confirms my experience: Good, long methods tended to list a number of trivial, but related details and were not suitable for further fragmentation. The structure was always simple, so they were easy to understand. They did one thing, did it well, and should/could not be subdivided in a meaningful way.
OK OK OK. I just glanced at the grammar.y code and its structure looked familiar. I stand corrected.
--
--
If the latter, are you saying that some functions/methods should never be further subdivided, even if they 200 lines long, because they map to something in our mental model which we don't naturally subdivide conceptually?
What if the methods we break them down with are private and used just to make the code more readable?
I'm sort of guessing now what you meant.... Honestly I'm confused what the discussion is about anymore we've gotten so deep in metaphor land -- my fault for starting it :)
Is TDD dead? Google hangout, recorded on May 9 (yesterday) with David Heinemeier Hansson (DHH), Martin Fowler & Kent Beck https://www.youtube.com/watch?v=z9quxZsLcfo
Part 1 of 6. Not much related to the discussion here, but the discussion was inspired by DHH's keynote too
Cope,From what I can tell, DHH is a fan of yours but ambivalent about DCI in general:
I don't know if you watched the video yet, but they had to end just when the discussion was about to get meaty and rise above vague kumbaya generalisations about which everyone agrees. They have another session planned for next week to continue where they left off.I would really love to see you on that panel -- you should send them an email, I'm sure they'd be excited to have you.
Den 11/05/2014 kl. 11.44 skrev Jonah S <jona...@gmail.com>:
Cope,From what I can tell, DHH is a fan of yours but ambivalent about DCI in general:Yes, but the point is that there are some basic notions that are pretty universal and which fly in the face of convention. Though it's good to have DCI cheerleaders it's also good to have thoughtful people from other sectors broadly fertilizing the earth with tangentially powerful ideas.I don't know if you watched the video yet, but they had to end just when the discussion was about to get meaty and rise above vague kumbaya generalisations about which everyone agrees. They have another session planned for next week to continue where they left off.I would really love to see you on that panel -- you should send them an email, I'm sure they'd be excited to have you.What is the goal? That is, after the panel, how will the world be a better place?Someone wrote to me about the DHH / Fowler / Beck panel and said he didn't have the patience to spend 30 minutes on a discussion that would go nowhere. I think that's a good assessment. I'd rather be outside any forum that sets itself up to have that reputation. If the folks are serious they would come together for a workshop and publish a joint work about the outcome. I could sign up for that. But panels are too much about theatre, and I'm a lousy actor.
> On Sunday, May 11, 2014 3:42:51 AM UTC-5, Cope wrote:> I think my unit testing article had a little to do with his talk, and that in turn was inspired in large part by DCI.>>>>>> Den 10/05/2014 kl. 17.55 skrev Herman Peeren <herman...@gmail.com>:>> Is TDD dead? Google hangout, recorded on May 9 (yesterday) with David Heinemeier Hansson (DHH), Martin Fowler & Kent Beck https://www.youtube.com/watch?v=z9quxZsLcfo>> Part 1 of 6. Not much related to the discussion here, but the discussion was inspired by DHH's keynote too>> --> You received this message because you are subscribed to the Google Groups "object-composition" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to object-composition+unsub...@googlegroups.com.
> To post to this group, send email to object-co...@googlegroups.com.> Visit this group at http://groups.google.com/group/object-composition.> For more options, visit https://groups.google.com/d/optout.>
--
You received this message because you are subscribed to the Google Groups "object-composition" group.
To unsubscribe from this group and stop receiving emails from it, send an email to object-composition+unsub...@googlegroups.com.
I think my unit testing article had a little to do with his talk, and that in turn was inspired in large part by DCI.
2014-05-11 11:42 GMT+03:00 James O. Coplien <jcop...@gmail.com>:I think my unit testing article had a little to do with his talk, and that in turn was inspired in large part by DCI.Thank a lot for this Cope, and for your own article about unit testing as well.
DHH wrote something I have always thought, but the "church of TDD" has been way too strong and I have been sometimes treated as an infidel. Now I can just say that "don't take my word, but check what DHH says".
Article by DHH is a more powerful hammer to use than yours, since unlike you (I suppose), DHH has been an advocate of TDD.
Maybe the most negative side of the TDD was that -- not very long ago -- you were not regarded as a professional, if you weren't a TDD-advocate.