R
Roedy Green
Consider the following refactoring problem.
There is a hunk of almost identical code that appears multiple times.
It sets up 6 local variables.
I would like to encapsulate it.
The obvious way to handle it is to make all the variables instance.
But they are ARE local. (I might be using threads)
Further their declarations would be scattered to the winds.
I could create a separate class just to hold the values. This is
tedious, but it may be the only way.
I think, why can methods have multiple inputs, but only one output? I
have been thinking that for about 50 years, and it ,seems unlikely to
change soon.
Any other thoughts on the problem? Is this new lambda feature of any
relevance?
--
Roedy Green Canadian Mind Products http://mindprod.com
The first 90% of the code accounts for the first 90% of the development time.
The remaining 10% of the code accounts for the other 90% of the development
time.
~ Tom Cargill Ninety-ninety Law
There is a hunk of almost identical code that appears multiple times.
It sets up 6 local variables.
I would like to encapsulate it.
The obvious way to handle it is to make all the variables instance.
But they are ARE local. (I might be using threads)
Further their declarations would be scattered to the winds.
I could create a separate class just to hold the values. This is
tedious, but it may be the only way.
I think, why can methods have multiple inputs, but only one output? I
have been thinking that for about 50 years, and it ,seems unlikely to
change soon.
Any other thoughts on the problem? Is this new lambda feature of any
relevance?
--
Roedy Green Canadian Mind Products http://mindprod.com
The first 90% of the code accounts for the first 90% of the development time.
The remaining 10% of the code accounts for the other 90% of the development
time.
~ Tom Cargill Ninety-ninety Law