encap/OO use question

Started by
60 comments, last by RolandofGilead 22 years ago
quote:Original post by supergeek2k
I do agree with what you are saying that designing something for a use that you can''t think of is pretty silly, but that is not what software reuse is all about. I don''t know where you got the idea that it is.

From the correct, rather than fallacious, meaning of reuse.

quote:
Nobody is suggesting that you have to design every class to be reusable in every instance. But you can put a little more effort into writing the classes that might be used in other contexts with a more generalized interface so that they do not have to be redesigned for further use.

By the definition of reuse, you don''t know about those other contexts when you design the original class. If you do know about other contexts, and you design for them, then it is *use*, not reuse, that you are achieving. That''s the point, using something for its intended purpose is *not* reuse! So, if you put in a "little more effort" to create "generalized interfaces", you don''t know if that effort is worthwhile, since you don''t really know the correctness of the design for future uses. Simple, no?
quote:
It is tried and proven to be profitable to do so.

Not by any reasonable definition of "proven", its not. If it had been proven, I wouldn''t be here arguing otherwise.
quote:
I guess the whole argument is over your definition of reuse. I have not found any reference to software reuse which fits your mold. Perhaps you can point me to one.

Do you not understand the difference between use and reuse? I was doing some DIY about my house at the weekend, and I had to drill some holes. I didn''t *reuse* my drill for the purpose, I simply *used* it for what it is was made for. The fact that various OO people came up with a rather woolly meaning of reuse around 10-15 years ago has little value to my mind.

Still, talking of value, I''m failing to see the value in me continuing this discussion. I am not concerned whether you see my point of view or not, I really don''t give a toss if you think I am an idiot. It''s simply not in my best interests to try and convince you of these ideas. I''ll leave you with one last thought... I remember around 6-7 years ago that I believed the same things you are now saying to me.
Advertisement
Please ignore this post.

quote:
I am not concerned whether you see my point of view or not, I really don''t give a toss if you think I am an idiot.

Guess what I think, im not saying, you don''t care!

So you had only used the drill once?
If you use anything more than once, its re-use. simple.
I think the problem here is communication (which I am rubbish at).
I think the problem would be solved if each time you used the word "use", and "re-use" you specified what you were reusing or using.

You can re-use a class in many different programs.
SabreMan, you seem to be talking about modifying functionality when you talk about re-use. You are saying if you reuse the ''module'' (or whatever) for what it was made for it is not re-use and that it only becomes re-use when you change/modify it.
quote:Original post by SabreMan
From the correct, rather than fallacious, meaning of reuse.


Still waiting for you to tell me where you get any alternate definition of the word ''reuse''.

quote:
By the definition of reuse, you don''t know about those other contexts when you design the original class. If you do know about other contexts, and you design for them, then it is *use*, not reuse, that you are achieving. That''s the point, using something for its intended purpose is *not* reuse! So, if you put in a "little more effort" to create "generalized interfaces", you don''t know if that effort is worthwhile, since you don''t really know the correctness of the design for future uses. Simple, no?


By YOUR definition of the word reuse maybe. Using something for it''s intended purpose is reuse if the intended purpose is not a single application! If you reuse the same code in the same application, then it is not reuse. If you use it more than once in more than one application, it is reuse.

quote:
Not by any reasonable definition of "proven", its not. If it had been proven, I wouldn''t be here arguing otherwise.


Well it has been proven to me. Maybe your standards of proof go beyond financial statements. Take a look at TRW, HOPS, Lockheed-Martin spendature on software development before and after adopting strict reuse policies. Take a look at the success of Sun, HP, Oracle, Cisco, etc... all of which have strict reuse policies on software design.

quote:
Do you not understand the difference between use and reuse? I was doing some DIY about my house at the weekend, and I had to drill some holes. I didn''t *reuse* my drill for the purpose, I simply *used* it for what it is was made for. The fact that various OO people came up with a rather woolly meaning of reuse around 10-15 years ago has little value to my mind.


I understand full the difference between use and reuse. Re-use is still use. But use is not necessarily re-use. That is why the word ''reuse'' is made up of the prefix ''re'' and the word ''use''.... re meaning what? Again... re-use = use again. What is so hard about that?

If I buy a drill-bit to drill some holes in some sheet-metal to build a shelf, and I later use that drill-bit to drill a hole in my car so that I can pull a dent, I am re-using that drillbit. I am still using it of course, but I am not using it for the purpose which I purchased it for. I may have known before I bought it that I could use that drillbit to pull a dent from my car, but I did not know some idiot was going to hit my car with a shopping cart while I was in Home Depot buying my drill-bit. I probably could have purchased a cheaper drillbit to drill in the sheet-metal a few holes before it is ruined, but thinking ahead I might want to use that drillbit for something else, so I buy a stronger titanium drill-bit. I am purchasing with the intent of re-use.


quote:
Still, talking of value, I''m failing to see the value in me continuing this discussion. I am not concerned whether you see my point of view or not, I really don''t give a toss if you think I am an idiot. It''s simply not in my best interests to try and convince you of these ideas. I''ll leave you with one last thought... I remember around 6-7 years ago that I believed the same things you are now saying to me.


It is a good thing you do not value my opinion of you The whole distorting the word ''reuse'' thing has lowered it considerably.

Peace,
Geek
quote:Original post by SabreMan
Original post by Supergeek2k[/i
Why don''t you provide me with the name of one person who is recognized by anybody as an expert in the field who says not ''envisaging'' something is correlated to the word ''reuse'' in any way?


What? Where did that twisted assertion come from? I certainly never uttered it. Your inability to understand a perfectly simple statement is quite unbelievable. Kevlin Henney is the main protagonist of the "reuse fallacy" debate, but I won''t claim he''s ever mentioned the rubbish you''ve just come out with. I can''t even make sense of what you''ve just said.


Hmmmmm…
quote:
IMO, reuse occurs when you turn a modular unit of s/w to a use that you never envisaged when writing it. If you can''t envisage the reuse, you can''t design for it. Any other use is just that - *use*.


Maybe from here???


Peace,
Geek
Stop all the pointless flaming. It''s getting pathetic to watch.

SabreMan you''re using a totally different definition of reuse than the rest of the industry and you''re just ignoring anyone that points it out. When you talk about writing code for "reuse" it seems to me that you really mean "writing swiss army knife code" which is nothing specific to OO or any paradigm. I can write bloated, feature-heavy code in any style. You''re confusing the conversation by sticking with your own (in my opinion bizarre) definition.
I have no more to say on the topic of "reuse". As DrPizza observed, I am talking to a brick wall. I''m pretty amazed at how many times people have put words in my mouth, plain misunderstood, or spectacularly missed the point. What really stinks is the propensity of certain individuals to suggest that I''ve invented the idea that I''ve discussed this with ACCU members, or the people who have seen fit to undermine the worth of the ACCU to instil greater value into their own viewpoint. I know which I think is the better source of experience and insight between Gamedev and ACCU.

For anyone who is genuinely interested (which doesn''t seem to be anyone who''s contributed), the details can be found. All it takes is a willingness to do some research. I know the view is contrary to established opinion, and there is far more pro-reuse information to be found. That is because what I have expressed is a fairly new idea. Those with a sense of history may be able to think back to what reuse actually means without their judgement being so clouded by propaganda, but I suspect most people here have grown up with OO and aren''t aware of how various terms came into current usage.
quote:Original post by supergeek2k
And I always evaluate the opposing arguments. I know there are some who advocate designing everything for your specific purpose and not thinking about future projects. I just don''t agree with them.

OK.

What functionality will your next project need?

Can you honestly answer that? I don''t even know what my next project *is*. And I know that''s not uncommon. I *can''t* design for my next project. If I try to make something excessively generic I''m wasting my time, because there is no way I can know what my next project will need.

quote:I do agree with what you are saying that designing something for a use that you can''t think of is pretty silly, but that is not what software reuse is all about. I don''t know where you got the idea that it is.

No, software reuse is about retasking a piece of code so that you use it for something it wasn''t designed for, usually requiring some inelegant manhandling to achieve the intended effect. This is in contrast to simply using a piece of code -- not modifying it, using it for what it was designed for.

quote:Nobody is suggesting that you have to design every class to be reusable in every instance. But you can put a little more effort into writing the classes that might be used in other contexts with a more generalized interface so that they do not have to be redesigned for further use.

Again, only if you''re prescient or if all your projects are incredibly similar. I''m not prescient, and my projects vary wildly.

quote:It is tried and proven to be profitable to do so.

No, actually, it isn''t.

quote:I guess the whole argument is over your definition of reuse. I have not found any reference to software reuse which fits your mold. Perhaps you can point me to one.

Reuse is retasking a piece of code to do something other than what it was originally intended to do. Using vector to store a one-dimensional array of objects isn''t reuse, it''s simply using it. Now if you were using it to, I dunno, represent a queue, for instance, you''d be venturing from its intended purpose, and you would either have to suffer from a vector''s ill-suitedness to the task (no constant-time insertions at the front, meaning you''d have to suffer a huge performance penalty or write a relatively complicated circular buffer, to reduce the need for reallocation and such). This would be reusing the vector, and would be suboptimal. You''d either have to add some layers over the top or suffer its inappropriateness. It''s this kind of thing that''s of little benefit.


char a[99999],*p=a;int main(int c,char**V){char*v=c>0?1[V]:(char*)V;if(c>=0)for(;*v&&93!=*v;){62==*v&&++p||60==*v&&--p||43==*v&&++*p||45==*v&&--*p||44==*v&&(*p=getchar())||46==*v&&putchar(*p)||91==*v&&(*p&&main(0,(char**)(--v+2))||(v=(char*)main(-1,(char**)++v)-1));++v;}else for(c=1;c;c+=(91==*v)-(93==*v),++v);return(int)v;}  /*** drpizza@battleaxe.net ***/


It''s really strange how hard this seems to be to understand.

The guy who invented the light bulb created it do
produce light.

It then was used to produce light in houses, for cars,
bicycles and so forth.
Sure, it was not necessary to invent the light bulb again
for cars and bicycles.
But, would you call this "re-use" ??
It''s nothing more than USEing existing technology, for what
it was invented to do with.
(like STL. Or would you call programming in C reuse, because
C instructions are translated into same asm code
for every time the instruction is used? )


Then, a bit later a guy found out that a light bulb
can also be useful to burn away old dye from painted
wood or something, for, a light bulb also produces
heat.
That''s re-use, I''d say.
The inventor didn''t think of this, he wanted to have electric
light.
But it can be used for other things, _without_ any additional
effort.


(just an example. I''m not sure if nowadays anyone uses
a light bulb to burn away color, seen it in an old b/w movie...


I fully agree that it''s waste of time to aim probably never-used
generality.
What''s the use of classes that _could_ be used for several things,
because you took care they could, but then get never used
for several things, in the end?
If you can use them, you''re lucky.
But this won''t be the case too often.

Main Entry: 2reuse
Pronunciation: -''yüs
Function: noun
Date: 1866
: further or repeated use


if I use it more than once, it''s reuse. It''s still using it, but it''s also now reuse, because it''s no longer the first time I used it.

I suggest you all go to the book store, and pick up a dictionary, because from what I can see, a lot of you need it!

This topic is closed to new replies.

Advertisement